esm-dev / esm.sh

A fast, smart, & global CDN for modern(es2015+) web development.
https://esm.sh
MIT License
3.07k stars 147 forks source link

Failed to import jsx-runtime #846

Closed sant123 closed 3 months ago

sant123 commented 3 months ago

Failing module

import { jsx, jsxs } from "https://esm.sh/react@18.3.1/jsx-runtime";

Error message

I get this type-checking error:

'"https://esm.sh/react@18.3.1/jsx-runtime"' has no exported member named 'jsx'. Did you mean 'JSX'?

Additional info

I know these functions have the following comment: You should not use this function directly. Use JSX and a transpiler instead.. However I'm aware of it and need to use them directly.

Thanks!!!

ije commented 3 months ago

i think it's caused by the incorrect dts, try https://esm.sh/react@18.3.1/jsx-runtime?no-dts

sant123 commented 3 months ago

It worked but it's typing is any now. However for what I need is okay.

image

Thanks @ije