-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 from non EcmaScript module (only default export is available) #675
Comments
Same problem here. Using |
Seems related and also the workaround mentioned in the discussion works. But it's strange as all the issues I found (here, here) describe this problem as "unable to do named import from CJS into ESM module". But VueDemi provides ESM build and after checking Webpack 4 docs (as Vue CLI is still on WP4), it has also correct settings in So I still don't understand why it is treated as "non EcmaScript module" |
Can someone provide a boiled down repro with only Vue and pinia (no router, or other unnecessary steps) |
I had the same problem but I solved editing my vue.config.js file with the following webpack rule: // vue.config.js
module.exports = {
configureWebpack: {
module: {
rules: [
{
test: /\.mjs$/,
include: /node_modules/,
type: "javascript/auto"
}
]
}
}
} With this configuration it worked. |
@posva I created a vue-cli project with a repro. Hope it helps. And when I try to import pinia: I get errors when running
|
@predragnikolic that's a lot of projects 😓 @MycroftHolmes1989 can you create a boiled down reproduction please? |
Here is the chained Webpack config if someone else needs it: vue.config.js:
|
I reproduced the issue on a simple project. This should be fixable by changing the extensions of the generated files. I still need to test it out a bit more. |
I get this error now when trying to upgrade from |
For NuxtJS:
|
It works |
@4Kazelot For the NuxtJS what file does this config go in? |
[[[> > > I had the same problem but I solved editing my vue.config.js file with the following webpack rule:
|
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
to our build config, we are still seeing the Here is some of our
We tried some experiments such as deleting ths |
If nothing worked you can try importing differently. Instead of
try
and then
|
This comment was marked as outdated.
This comment was marked as outdated.
If you are using CRACO for react app, add the following webpack configuration to your craco.config.js:
|
Steps to reproduce the behavior
yarn add pinia@next
.main.ts
:yarn serve
.Expected behavior
The compilation goes without an error
Actual behavior
Throws error:
Additional Information:
The text was updated successfully, but these errors were encountered: