New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
npm specifiers don't seem to work in islands #955
Comments
Greetings, I think npm specifiers stabled. But our actual islands code or any route code are all transpiled using esbuild - A transpiler to convert ts, jsx to js. So the thing is esbuild is not specifically built for deno. So it not transpile source from npm specifiers yet. Maybe in future it will be. I hope. Thank You |
I've run into the same issue today. It's driving me bonkers. |
A small hack that is |
I am also running into this issue. It would be very helpful to support npm specifiers in islands |
evanw/esbuild#2782 |
I took a quick look at how Fresh builds with |
Hey, thanks for the information that it uses denoplugin. But i think that issue is for |
you can go for it if you want 👍 |
Not sure if this is dup #974, maybe. Will follow what is mentioned here. |
It was almost done.. i made a PR here need some tests... Just making sure everything is fine..lucacasonato/esbuild_deno_loader#33 |
Closing as duplicate of #978 |
Using npm specifiers like
import { camelCase } from "npm:lodash"
orimport { optimize } from "npm:svgo"
works fine outside of islands, but using them in islands throws with this error:The site still seems to load fine and the affected component even renders once, but obviously stops working after that. I guess only the browser rendered part of the component crashes but I honestly don't really know.
Normally a workaround for this would be using something like https://esm.sh, but for some modules like
svgo
ordompurify
I can't seem to find a way to get it working without usingnpm:dompurify
.Made a reproduction repo: https://github.com/nnmrts/fresh-npm-test
Sorry if this is expected, perhaps because npm specifiers are still unstable (I think?), but would still appreciate some sort of workaround.
The text was updated successfully, but these errors were encountered: