Nuxt.js: [edge] Nuxt.js uses the local Vue instance in plugins

Created on 6 Jun 2018  路  4Comments  路  Source: nuxt/nuxt.js

Version

2.0.0-25468832.6578bd7

Reproduction link

https://github.com/negezor/nuxt-edge-plugins-error

Steps to reproduce

Clone the repository
Install modules
Run
Look in the console

What is expected ?

In a global context, Vue should using mixin

What is actually happening?

Mixing is added to the local Vue instance

Additional comments?

Roughly, you can change the local version to global in the module.

This bug report is available on Nuxt community (#c7203)
bug-confirmed bug-report

Most helpful comment

Hi. Thanks for reproduction repository.

About this:

I think this problem is due to the use of esm

It is not. ESM is only required in the context of Nuxt itself, not for runtime. Webpack bundles everything and parses jsx files.

Also, this is normal that requiring vue in a file inside of node_modules does not guaranty same versions. Nuxt copies every template into .nuxt directory.

This bug seems a regression with recent Webpack/Vuelidate releases.

UPDATE

Simply renaming plugins/vuelidate.jsx to plguins/vuelidate.js seems to fix the problem. (Temporary solution)

All 4 comments

Hi. Thanks for reproduction repository.

About this:

I think this problem is due to the use of esm

It is not. ESM is only required in the context of Nuxt itself, not for runtime. Webpack bundles everything and parses jsx files.

Also, this is normal that requiring vue in a file inside of node_modules does not guaranty same versions. Nuxt copies every template into .nuxt directory.

This bug seems a regression with recent Webpack/Vuelidate releases.

UPDATE

Simply renaming plugins/vuelidate.jsx to plguins/vuelidate.js seems to fix the problem. (Temporary solution)

After I renamed the files in the plugins from mjs to js, yes, now it works.

This bug-report has been cancelled by @manniL.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lazycrazy picture lazycrazy  路  3Comments

maicong picture maicong  路  3Comments

vadimsg picture vadimsg  路  3Comments

VincentLoy picture VincentLoy  路  3Comments

uptownhr picture uptownhr  路  3Comments