pixelmund / svelte-kit-cookie-session

⚒️ Encrypted "stateless" cookie sessions for SvelteKit
MIT License
182 stars 11 forks source link

Build Fails in Vercel #36

Closed bitcrshr closed 2 years ago

bitcrshr commented 2 years ago

It appears that although everything works fine in dev and preview, the build fails in Vercel. This may very well be an issue for the adapter-vercel folks, but I figured I would check in here. Looks like it's an issue with the zencrypt dependency. Here's the error I get:

image

Any tips here?

pixelmund commented 2 years ago

Seems like the svelte-kit vercel adapter only builds a cjs bundle. I'll probably remove the polyfill which uses top-level await in zencrypt and require the user to polyfill the global webcrypto, which is already done by svelte-kit. Will try to get a new version out soonish.

bitcrshr commented 2 years ago

Nice, thank you! I actually had success with just changing the await import(...) to import(...).then(...), and making a patch with patch-package. Works beautifully now!