You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fork the CodeSandbox (seems to be required for experimental features used by codesandbox-nuxt)
Go to Server Control Panel
Click "Restart Server" in Control Container
Look at Terminal under the Browser Preview after the line :
> Sandbox Container: Sandbox <xxxxx> started
yarn run v1.22.4
[...]
What is expected ?
The foo module should be print twice the console.log defined in /modules/foo/index.js because nuxt.config.js contains two times '/modules/foo' in options.modules, with different modules' options. See Additional comments for the output of the console.log.
What is actually happening?
The foo moduleprints only once the console.log.
Additional comments?
I've added a "foo" module that do a simple console.log for demo purpose. I expect it to be called twice, but it is not the case.
Reproduction link details
The console.log output for the NOT WORKING CodeSandbox (the one in the "Reproduction link") is :
[nuxt-v2.13.1] foo module being added, options: {
foo: 'bar'
}
The console.log output for the WORKING CodeSandbox is :
[nuxt-v2.12.2] foo module being added, options: {
foo: 'bar'
}
[nuxt-v2.12.2] foo module being added, options: {
bar: 'baz'
}
Real use case
The real use case is a module copying files base on a template. The copy is done using addTemplate with the same source file to a different destination and options (based on module options). Each time the module is referenced in the nuxt.config.js, I need to execute the module in order to generate needed files.
This bug report is available on Nuxt community (#c10845)
The text was updated successfully, but these errors were encountered:
Hi @pi0. Thank you for the tip on the use case. I'll refactor my code to fit to the new version, I wasn't aware on bests practices on how modules should be added to nuxt.config.js.
Version
v2.13.1
Reproduction link
https://codesandbox.io/s/nuxt-module-issue-not-working-k40t5
Steps to reproduce
What is expected ?
The foo module should be print twice the console.log defined in
/modules/foo/index.js because nuxt.config.js contains two times '/modules/foo' in options.modules, with different modules' options. See Additional comments for the output of the console.log.What is actually happening?
The foo moduleprints only once the console.log.
Additional comments?
I've added a "foo" module that do a simple console.log for demo purpose. I expect it to be called twice, but it is not the case.
Reproduction link details
The console.log output for the NOT WORKING CodeSandbox (the one in the "Reproduction link") is :
A working example
Here found a WORKING CodeSandbox using nuxt@2.12.2 : https://codesandbox.io/s/nuxt-module-issue-working-lnzpc
The console.log output for the WORKING CodeSandbox is :
Real use case
The real use case is a module copying files base on a template. The copy is done using addTemplate with the same source file to a different destination and options (based on module options). Each time the module is referenced in the nuxt.config.js, I need to execute the module in order to generate needed files.
The text was updated successfully, but these errors were encountered: