Closed INTERNAL-ERROR closed 2 years ago
Same happens to me. I've posted on Netlify forum as well: https://answers.netlify.com/t/debugging-advice-when-trying-to-deploy-sveltekit-to-netlify-cannot-find-module-llhttp-llhttp-simd-wasm-js-from-opt-build-repo-netlify/70397
I’ve just had the same thing happen to me, but fixed the issue by using @sveltejs/adapter-netlify directly (rather than via @sveltejs/adapter-auto) and pinning to the previous version of the adapter.
npm add -D @sveltejs/adapter-netlify@1.0.0-next.65
Same here
I’ve just had the same thing happen to me, but fixed the issue by using @sveltejs/adapter-netlify directly (rather than via @sveltejs/adapter-auto) and pinning to the previous version of the adapter.
npm add -D @sveltejs/adapter-netlify@1.0.0-next.65
I have the exact same issue, tried your fix bit it didn't work for me, I still get the same error. Is it implemented in the same way as in the docs (https://github.com/sveltejs/kit/tree/master/packages/adapter-netlify#installation) or did you do something else?
Same here
Just tried building it locally using netlify build
and it works fine. Still the same issue when deploying though, seems to be enviroment related.
Just tried building it locally using
netlify build
and it works fine. Still the same issue when deploying though, seems to be enviroment related.
I can't netlify build even in local.
I’ve just had the same thing happen to me, but fixed the issue by using @sveltejs/adapter-netlify directly (rather than via @sveltejs/adapter-auto) and pinning to the previous version of the adapter.
npm add -D @sveltejs/adapter-netlify@1.0.0-next.65
This works for me.
I’ve just had the same thing happen to me, but fixed the issue by using @sveltejs/adapter-netlify directly (rather than via @sveltejs/adapter-auto) and pinning to the previous version of the adapter.
npm add -D @sveltejs/adapter-netlify@1.0.0-next.65
Workss!!
I fixed this issue by downgrading to version 65 instead of 66. Then followed the normal Netlify tutorial
Yep, downgrading to version 65 worked for me. Soooo, something went wrong in there, and I'll alert the devs. Thanks so much, everyone!
I managed to get my SvelteKit app to build on Netlify by downgrading @sveltejs/adapter-netlify
to version 65 instead of 66 and by using the following netlify.toml
:
[build]
command = "npm run build"
publish = "build"
functions = "build/functions/"
[dev]
command = "svelte-kit dev"
[functions]
directory = "netlify/functions"
node_bundler = "esbuild"
But when I try and run the app it crashes with the following error message (in Chrome):
Runtime.ImportModuleError - Error: Cannot find module 'stream/web' Require stack: - /var/task/.netlify/functions-internal/render.js - /var/task/render.js - /var/runtime/UserFunction.js - /var/runtime/Runtime.js - /var/runtime/index.js
Let's reopen this one. I don't see an open issue on it and it is still currently broke on the @next
version of adapter-netlify.
Even downgrading is no longer working for me on a new site with the downgraded version of the adapter @sveltejs/adapter-netlify@1.0.0-next.65
. Getting error in build:
8:33:47 AM: Error message
8:33:47 AM: A Netlify Function failed to require one of its dependencies.
8:33:47 AM: Please make sure it is present in the site's top-level "package.json".
8:33:47 AM: In file "/opt/build/repo/.netlify/functions-internal/render.js"
8:33:47 AM: Cannot find module './llhttp/llhttp_simd.wasm.js' from '/opt/build/repo/.netlify'
@brittneypostma
Check your package-lock for references to @sveltejs/adapter-netlify": "1.0.0-next.66"
. That was the fault in my case I had some lingering references to the latest version of the adapter.
I tried manually changing all instances of it and removing the package-lock completely and still getting an error.
llhttp is from Undici: https://github.com/sveltejs/kit/pull/5117
I can workaround this by setting edge: true
@ascorbic I'm stumped on this one. Any ideas why adding Undici to SvelteKit might have broken deploys on Netlify?
Hey @benmccann. The require
in question is in shims.js
, which contains the line:
mod = await WebAssembly.compile(Buffer.from(require('./llhttp/llhttp_simd.wasm.js'), 'base64'));
That file doesn't exist, so when it tries to bundle the function, it fails. This seems to be an error in the Vite bundling process, because that require is still in the compiled shim file.
Thank you! I believe the bug was in @rollup/plugin-commonjs
. I'm not seeing it locally where the plugin was bumped, but it looks like the last release of the Netlify plugin failed, so people aren't getting the fixed version. I'll ask someone who knows more about releases how we can get a new version out
I’ve just had the same thing happen to me, but fixed the issue by using @sveltejs/adapter-netlify directly (rather than via @sveltejs/adapter-auto) and pinning to the previous version of the adapter.
npm add -D @sveltejs/adapter-netlify@1.0.0-next.65
This works for me.
Thanks worked for me, life saver
I've just checked and can confirm that the new version fixes it for me!
great! thank you!!
I am still having issues, related?
That looks like a different issue @ghostdevv. My guess would be that your version of Node is too old
@benmccann I thought that too before I found this issue. I am on node 16? I can also try 18 if netlify supports that
The minor version often matters as well. You might want to make sure you're on the latest Node 16
The default node Lambda runtime on Netlify is currently 14 (though it's changing to 16 on Monday), so you may need to manually set it. Set the env var AWS_LAMBDA_JS_RUNTIME
to nodejs16.x
and do a new deployment.
@ascorbic That fixed it ty
The changed default runtime has now rolled out, so new deploys should be on 16 now unless manually specifying another version.
sharing for others to find - i also had this issue but a redeploy didnt fix it because i had AWS_LAMBDA_JS_RUNTIME
set to nodejs14.x
(presumably to force it from when the default was node 12). bumped to node16 and redeployed and it is fine now. feels kinda brittle :shrug: but dont have a better idea how to handle
@sw-yx I think now that Netlify's default is 16, you should be able to remove it completely.
If you are seeing this and trying to deploy a svelte app to netlify and none of the above options work. Try to check if you have git config core.ignorecase if it's true try to change it to false with the following command
git config core.ignorecase false
this worked for me
Describe the bug
After I updated Svelte to the latest update, I encountered an error that I can't seem to overcome when deploying to Netlify, from code written by Sveltekit in the .netlify foldered.
I have all the latest versions of - Svelte, Sveltekit, SvelteKit Netlify Adapter, and llhttp.
Everytime I try to deploy, I get this error:
I've installed llhttp in the top level package.json. I went digging, and in the file ".netlify/shims.js" on line 3396, it trys:
mod = await WebAssembly.compile(Buffer.from(require('./llhttp/llhttp_simd.wasm.js'), 'base64'));
This is where the error is coming from, I believe.My code is hosted on replit: https://replit.com/@AcousticTypewriter911/AudreyTk#app And Github:https://github.com/INTERNAL-ERROR/AudreyTk
Would welcome and advice on how to correct this error. I can "npm run build && npm run preview" without error, this only happens in production.
Reproduction
I have followed every step in how to install Svelte & Sveltekit, and how to run it on Netlify. I'm not sure where I went wrong.
Logs
System Info
Severity
blocking all usage of SvelteKit
Additional Information
I won't be able to use sveltekit if this error is not fixed.