-
Notifications
You must be signed in to change notification settings - Fork 74
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 project build failed with: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './nuxt' is not defined by "exports" in vue-sweetalert2\package.json #160
Comments
Yes, I have the same problem but I can't change the package.json because I'm creating a docker image |
Same issue +1 |
Same +1 |
1 similar comment
Same +1 |
Hi all. |
Same +1 "nuxt": "^2.15.7" |
@caglarduman Update to the latest version. And if there is an error, please send the log. |
Hello, I encountered the same issue. I attempted to change my Node.js version from 18 to 16.20.2, and it resolved the error. |
When I used the "^" symbol in the "vue-sweetalert2": "^5.0.2" line in the package.json, it automatically used version 5.0.10, which is the latest released version. I removed the "^" symbol and forced it to use version 5.0.2. The issue was resolved. I think the problem was in the latest version. |
@caglarduman I apologize for taking so long. Can you look up version 5.0.11? |
Describe the bug
When building my nuxt project that includes vue-sweetalert2 using yarn, the build failed with following error:
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './nuxt' is not defined by "exports" in vue-sweetalert2\package.json
we import vue-sweetalert2 in nuxt.config.js:
modules: [
// https://go.nuxtjs.dev/bootstrap
"bootstrap-vue/nuxt",
"vue-sweetalert2/nuxt"
],
To fix it, I had to manually change:
node_modules/vue-sweetalert2/package.json by adding:
"./nuxt": "./nuxt/index.js"
to:
"exports": {
".": {
"import": "./dist/vue-sweetalert.mjs",
"require": "./dist/vue-sweetalert.umd.js",
"types": "./dist/index.d.ts",
"default": "./dist/vue-sweetalert.js"
},
"./nuxt": "./nuxt/index.js" // added this line
}
If there is a solution where we don't have to change package.json will be ideal.
I also want to know
The text was updated successfully, but these errors were encountered: