Rich-Harris / code-red

Experimental toolkit for writing x-to-JavaScript compilers
MIT License
332 stars 22 forks source link

import error on function 'encode' of @jridgewell/sourcemap-codec #85

Open GonerGenesis opened 3 months ago

GonerGenesis commented 3 months ago

Hi, I've got a strange client (browser) side issue while trying out @jycouet 'firstly' lib. The code-red module is complaining about a missing import/export from @jridgewell/sourcemap-codec:

SyntaxError: The requested module '/node_modules/.pnpm/@jridgewell+sourcemap-codec@1.4.15/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js?v=1d7d69f3' does not provide an export named 'encode' (at index.js:3:10)

but it is definitely there: image

I don't think it's a problem with code-red but with some issue of the pnpm-vite-svelte build process of the lib or how the package install is handled on my site, but I'd like to have a clue about whats going on. Is there any idea? Cheers

GonerGenesis commented 3 months ago

It looks like vite doesn't resolve the packages correctly, or why does the umd version gets imported?