#Property 'div' does not exist on type 'JSX.IntrinsicElements'.

2 messages · Page 1 of 1 (latest)

gilded garnet
#

I'm building a sample primitive npm package which is going to be an ESM package.
I have only one file in there - bar.tsx with the following:

export const Bar = () => <div>Boo</div>

If"module": "CommonJS" , then build works.
But once I set "module": "ESNext" - it fails like this:


src/bar.tsx:3:26 - error TS2339: Property 'div' does not exist on type 'JSX.IntrinsicElements'.

3 export const Bar = () => <div>Boo</div>
                           ~~~~~


Ideas?

jade perch
#

I asked chatgpt,maybe you can have a try.