You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since my last bug report was little hastily conjured, I tried to take time with this. However, it seems there is a bug with SvelteKit's build process. Basically what happens is that I'm using a library that defines exports block with the values:
When I try to run svelte-kit build it somehow resolves the "import" entry as CJS. Deleting this block and letting the library be resolved with "main" and "module" entries fixes it so I think there's something wrong here. I added Rollup and Vite bundling of the same library which do resolve it correctly using "exports".
Note the .js and .cjs. These extensions combo are usually used when the package.json is type: "module", but it's not. What it should be instead is .mjs and .js, since that's how node detects the file format (ESM or CJS). If they want to stick with the extensions they have now, they need to use type: "module".
There seems to be a similar issue there yjs/y-websocket#72, so I'm closing this in favor of that.
Describe the bug
Since my last bug report was little hastily conjured, I tried to take time with this. However, it seems there is a bug with SvelteKit's build process. Basically what happens is that I'm using a library that defines exports block with the values:
When I try to run
svelte-kit build
it somehow resolves the "import" entry as CJS. Deleting this block and letting the library be resolved with "main" and "module" entries fixes it so I think there's something wrong here. I added Rollup and Vite bundling of the same library which do resolve it correctly using "exports".Reproduction
https://github.com/TeemuKoivisto/exports-import-not-es-module
Logs
No response
System Info
Severity
blocking an upgrade
Additional Information
No response
The text was updated successfully, but these errors were encountered: