pixelmund / svelte-kit-cookie-session

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

Not compiling in Vercel getting Cannot find module error #26

Closed phocks closed 2 years ago

phocks commented 2 years ago

Hi there, I'm getting:

Cannot find module '/home/phocks/sites/quote.ga/node_modules/svelte-kit-cookie-session/dist/esm/core' imported from /home/phocks/sites/quote.ga/node_modules/svelte-kit-cookie-session/dist/esm/handle.js

Something to do with the esm modules or something?

phocks commented 2 years ago

Just letting you know I managed to get it building with the Vercel adapter by copying the dist/esm folder to my $lib folder and just importing it from there. Not ideal, and not sure why the error is happening, but it works.

pixelmund commented 2 years ago

I think it's this line https://github.com/pixelmund/svelte-kit-cookie-session/blob/fd8612a56b748b6632c2f1a7fc8cc938352aa4d8/src/handle.ts#L1 the ./core is missing the .js extension which is required within esm. I can hopefully get to fix it soon!

pixelmund commented 2 years ago

This should be fixed in 2.0.2