Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node_modules with "." in their module path accidentally whitelisted from nodeExternals (e.g. @sum.cumo/vue-states) #7462

Closed
JohannesLamberts opened this issue Jun 4, 2020 · 0 comments · Fixed by #7464

Comments

@JohannesLamberts
Copy link

JohannesLamberts commented Jun 4, 2020

Version

v2.12.2

Reproduction link

https://github.com/JohannesLamberts/nuxt-bug-externals-whitelist

Steps to reproduce

Follow steps from https://github.com/JohannesLamberts/nuxt-bug-externals-whitelist/blob/master/README.md

What is expected ?

Modules are only whitelisted in webpack nodeExternals if manually specified in nuxt.config.js.

What is actually happening?

Modules are always whitelisted in webpack nodeExternals if they contain a "." in their path.

Additional comments?

One side-effect of this behaviour is, that the package from node_modules is re-executed whenever the bundle is re-executed.
That is once per SSR-request in devMode, since the default for runInNewContext is then set to true.

The re-execution produces a new Instance of the plugin, which effectively disables the Vue.js internal check if the Plugin has already been installed.
Since the Vue module is not re-executed, the Plugin is then installed multiple times, which can lead to secondary, Plugin-dependent Bugs.

In case of @sum.cumo/vue-states the Plugin (unsuccessfully) tried to redefine a property on a component once per installation.

This bug report is available on Nuxt community (#c10729)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants