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

Can't import the named export 'isVue2' from non EcmaScript module #171

Closed
taidaid opened this issue Jul 11, 2022 · 1 comment
Closed

Can't import the named export 'isVue2' from non EcmaScript module #171

taidaid opened this issue Jul 11, 2022 · 1 comment

Comments

@taidaid
Copy link

taidaid commented Jul 11, 2022

Hello, I understand that this may not be exactly the right place for this question, but it seems related to vue-demi, so I thought people here might be able to help.

This is a repost from this issue thread.

Thanks for taking a look.


Hello, we are trying to use Pinia alongside Vuex in a Nuxt 2 project in order to smooth our eventual migration to Nuxt 3. However, even after adding

    extend(config) {
      config.module.rules.push({
        test: /\.mjs$/,
        include: /node_modules/,
        type: 'javascript/auto',
      })
    },

to our build config, we are still seeing the Can't import the named export 'isVue2' from non EcmaScript module (only default export is available). The error comes from our ./.nuxt/dist.plugin.209980bd.mjs file which seems to be the @pinia/nuxt plugin setup.

Here is some of our package.json

// dependencies
"nuxt": "2.15.8",
"vue": "2.6.14",
"@nuxtjs/composition-api": "^0.23.2" ,
"@pinia/nuxt": "^0.1.9",
"pinia": "^2.0.14

// devDependencies
"@nuxt/typescript-build": "2.1.0"

We tried some experiments such as deleting the .cjs file from vue-demi, but it seems that no matter what we do, the file is not reading the .mjs file correctly.

@knirirr
Copy link

knirirr commented Oct 22, 2024

@taidaid may I ask what your solution to this was? Unfortunately, I've run into the same problem (same scenario as you). Thanks!

Edit:

In case anyone else finds this, what eventually fixed it for me was this:

 {
          test: /\.mjs$/,
          include: [/node_modules/, /.nuxt/],
          type: "javascript/auto"
},

knirirr added a commit to ISA-tools/ptox-metadata-manager-client that referenced this issue Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants