Skip to content
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

deno check: This JSX tag requires the module path 'react/jsx-runtime' to exist, but none could be found. #28221

Closed
kuchta opened this issue Feb 21, 2025 · 4 comments · Fixed by #28228

Comments

@kuchta
Copy link

kuchta commented Feb 21, 2025

Version: Deno 2.2.1

After upgrading to latest version, deno check errors on first jsx expression in each file with error:

TS2875 [ERROR]: This JSX tag requires the module path 'react/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed.
    <>
    ~~
    at file:///Users/kuchta/Projects/vite-project/src/App.tsx:10:5

In newly initialzed Vite/React project by deno init --npm vite with config:

$ cat deno.jsonc 
{
	"compilerOptions": {
		"jsx": "react-jsx",
		"lib": [ "ESNext", "DOM", "DOM.Iterable" ],
		"types": [ "node", "vite/client", "@types/react" ]
	}
}

I think it would be great, if deno could recognize it's initializing new react project a create minimal working config file. A lot of issues would then probably go away...

@dsherret
Copy link
Member

dsherret commented Feb 21, 2025

Can you show what commands you're running so someone can easily reproduce this?

@dsherret dsherret added the needs info needs further information to be properly triaged label Feb 21, 2025
@dsherret
Copy link
Member

I just hit this myself.

@dsherret dsherret removed the needs info needs further information to be properly triaged label Feb 21, 2025
@dsherret
Copy link
Member

As a workaround, it looks like adding "jsxImportSource": "react" makes it work.

@dsherret
Copy link
Member

Caused by #27857

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants