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
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/var/task/node_modules/[Some Module]/[Name].esm.js #10468
Comments
We are using the node adapter, but we recently noticed the same behavior, and I changed added some ssr configuration to our vite.config.ts file: /** @type {import('vite').UserConfig} */ I'm not sure if something changed with sveltekit or with vite recently, but this didn't seem to be necessary 4+ weeks ago. I've tried rolling back sveltekit versions to see if that made a difference (it didn't), but I haven't done the same for the node adapter or vite. Adding that ssr, noExternal config to the vite config is our solution for now. |
So, we discovered our actual issue was we had a .dockerignore file that was keeping some node_modules out of our containers. So I'm actually removing that unnecessary ssr configuration from the vite config. |
i am also have same issue but in defferent package when i deploy my backend project on vercel it and give me same error but it run on my machine fine not only just that it also run on vercel few time and i just update some cors configration to access backend from my frontend it crash and i didn't find any solution on internet if any has any idea pleas help me out i wana deploy my project Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/var/task/node_modules/stripe/esm/stripe.esm.node.js' imported from /var/task/controller/payments.js |
closing as it seems to be fixed by wavesurfer.js and I can't reproduce it on the latest version of wavesurfer.js
I can't reproduce this issue with |
Describe the bug
Pretext: I'm not sure if this is a general SvelteKit problem yet. It might be.
I'm using a project called wavesurfer.js. That project has some plugins, for example
wavesurfer.js/dist/plugins/regions.js
. Sveltekit tries to import wavesurfer.js/dist/plugins/regions.esm.js once built and deployed to Vercel (and Netlify too). That leads to this error message:This error however only appears if I deploy to Vercel or Netlify. It doesn't happen locally if I build and preview the project. Since it happens both on Vercel and Netlify, I thought it's probably a Sveltekit issue, as it's the common denominator.
I had also created an issue at wavesurfer.js but as the author stated, it's probably not a wavesurfer issue.
Reproduction
npm install --save wavesurfer.js
+page.svelte
file:npm i -D @sveltejs/adapter-vercel
svelte.config.js
file:Logs
System Info
Severity
annoyance
Additional Information
No response
The text was updated successfully, but these errors were encountered: