Cannot find module pinia\dist\pinia.prod.cjs
when using npm package that exports pinia store only when deployed to vercel
#2286
-
Reproductionhttps://github.com/kimbaudi/vue3-nuxt-demo & https://github.com/kimbaudi/vue3tslibtest Steps to reproduce the bug
Expected behaviorWhen I deploy a nuxt project to vercel (that consumes an npm package that exports a pinia store), I expect the deployment to be successful without any issues. Actual behaviordeploying a nuxt project to vercel (that consumes an npm package that exports a pinia store), causes a 500 error that module Additional informationThis issue is related to nuxt/nuxt#19847. Before I deployed nitro: {
alias: {
pinia: "pinia",
},
}, After adding the above configuration, the issue was resolved locally during build so I then proceeded to deploy to vercel. Unfortunately, the 500 cannot find module error exists after deploying to vercel. Looking at nuxt/nuxt#19847 (comment), it seems that If this is the case, how can use pinia outside of a vue context in a nuxt project so that when I deploy to vercel I don't get the 500 cannot find module error? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
There are discussions mentioning this issue:
Also, from nuxt/nuxt#15058 (comment):
|
Beta Was this translation helpful? Give feedback.
-
It seems the main issue is that |
Beta Was this translation helpful? Give feedback.
The workaround is in issue: nuxt/nuxt#20128 😉