Closed mcmxcdev closed 3 months ago
CodeMirror provides ESM packages. Given the ridiculous error message, I'm inclined to believe this is a bug in vite or some other part of your toolchain. Feel free to reopen if you have something more actionable, though.
I guess it might be a problem caused by the non-compliant exports
field. Try loading the package in the following way:
"exports": {
".": {
"types": "./index.ts",
"svelte": "./index.ts",
// add field
"default": "./index.ts"
}
},
Thanks for the suggestion! I just tried that, but it still fails with the same error message unfortunately.
Describe the issue
We have been using codemirror without any issues for a couple months now in a Sveltekit project, but when trying to update our reusable packages/ui
package.json
to useexports
like in the example on turborepo, the Vite build starts erroring with the following stacktrace:I was able to pinpoint it down to codemirror by running vite build multiple times with different files referenced and commented in/out. Our other apps in the monorepo not using codemirror still build successfully.
Not sure how to solve this, but it seems that codemirror would need to move to ESM to get rid of the error?
Browser and platform
Version 1.63.169 Chromium: 122.0.6261.111 (Official Build) (64-bit), Ubuntu 23.10
Reproduction link
No response