Build using edge compatible versions of libraries #10456
Unanswered
Nick-Mazuk
asked this question in
Q&A
Replies: 1 comment 1 reply
-
I had a similar issue but it was happening with libsql. I fixed it by importing the correct non-node version. I think your only option is to find if there is a proper non-node import from the packages causing issues. If it helps at all I switched to using Lucia auth because it seemed more edge friendly: https://github.com/justinfriebel/sveltekit-turso-drizzle |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
There are several npm modules I've tried to use with the Vercel adapter on the edge that result in build time errors. Each of these support the edge runtime, but for some reason Sveltekit keeps building using the NodeJS versions of the libraries.
How can I tell Sveltekit to build using the edge version of the libraries?
For context, here's my svelte config:
Example:
jose
I'll use Jose as an example because that's a fairly popular library.
When I build using Jose, I get the following error:
I also get the same errors for crypto, util, and zlib.
Jose supports Vercel's edge.
Interestingly, these errors seem to come after the main build step:
References
Beta Was this translation helpful? Give feedback.
All reactions