-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Nuxt / Webpack / Vue CLI build fails with v6.2.0 and above #718
Comments
That's weird, can you remove the |
I found this can confirmed it fixes the same issue on Vue CLI https://stackoverflow.com/a/64907659 Nuxt// nuxt.config.js
module.exports = {
build: {
extend (config) {
config.module.rules.push({
test: /\.mjs$/,
include: /node_modules/,
type: "javascript/auto"
})
}
}
} Vue CLI// vue.config.js
module.exports = {
configureWebpack: {
module: {
rules: [{
test: /\.mjs$/,
include: /node_modules/,
type: "javascript/auto"
}]
}
}
} /cc @pi0 @danielroe @sodatea I am not super familiar what is going on internally in webpack, but if this fix makes sense, should we include it by default in Nuxt / Vue CLI? |
Likely this should be included by default for wp4 in Vue CLI. It should already be present in next version of Nuxt (2.16): nuxt/nuxt#9180 And it is already injected by |
Closing this as this is not an issue of the project itself and an workaround is provided. |
Thanks for the provided workaround! I've added it to my nuxt.config.json, but the problem still persists:
Using nuxt 2.15.8 and @nuxtjs/composition-api 0.28.0. Would the workaround be to wait for Nuxt 2.16 to be released and hold back the update until then @danielroe? |
Can you share a minimal reproduction? Thanks. |
Nuxt The // nuxt.config.js
export default {
build: {
extend(config) {
config.module.rules.push({
test: /\.mjs$/,
include: /node_modules/,
type: "javascript/auto"
});
}
}
} |
Tried the proposed solution above from @daofresh, but now the error is this:
|
@patrikengborg Would you check whether there is a problem when you upgrade to the latest version of node 12 or 14 (and also ensure you are using the latest version of vue composition API). |
@danielroe I'm on node 14.17.5 and upgrading the composition api to latest seems to have solved it, thanks! |
Thanks for your reply, I had it in my build config, but failed to copy the config correctly into this issue ;) |
I had that problem with Nuxt, but fixed it by updating |
I cannot reproduce it with a new nuxt repo, so it has to be somewhere in my configuration or modules. I will have to fix that myself :) |
I can confirm that this also worked for me, Nuxt 2.15.7 and @nuxtjs/composition-api": "^0.27.0 (@vueuse/core v6.2.1) |
@antfu I am using this library wih ionic 5 with vue and I am not able to resolve it this with given suggesions. |
@antfu Hello, |
The way I see it is that Webpack 4 should release a patch to have built-in support for .mjs files (Note that Webpack 5, Vite, Rollup are working fine with this). Giving the whole ecosystem is moving in that direction, it's not a problem that is only limited to this library. For some context:
|
I've been trying to get rid of this error using the configuration proposed by @antfu in a Storybook + Vue + Typescript project. |
@antfu I used cli so that the configuration would work properly locally, but element-plus was not packaged into the project when it was packaged. |
@Bliangjs The problem you described has NOTHING to do with VueUse, please report issue to element-plus project. |
If you're using Vue CLI 4, please upgrade to latest version. /~https://github.com/vuejs/vue-cli/releases/tag/v4.5.15 |
Since 6.2.0, Nuxt fails to build (I think because of the changed file extensions):
The text was updated successfully, but these errors were encountered: