Skip to content

[BUG] 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. #61756

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

Open
jcalfee opened this issue May 22, 2025 · 2 comments

Comments

@jcalfee
Copy link

jcalfee commented May 22, 2025

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.100.23258
  • OS Version: Linux x64 6.9.3-76060903-generic
  • Chromium: 132.0.6834.210
  • Node.js: 20.19.0
  • V8: 13.2.152.41-electron.0

Steps to Reproduce:

  1. Open a .tsx file in a solidjs project (probably any non-react project) and observe all JSX syntax triggers a typescript error masking other potential ts errors.

Image

  • 1.100 always happens and the error changed to 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. See merge

Prior versions showed up like this:

  • 1.95.3
  • 1.98.2.25078 it occasionally happened but the error was "This JSX tag requires 'React' to be in scope, but it could not be found."

Image

A work-around is appreacted!

@mjbvz mjbvz transferred this issue from microsoft/vscode May 22, 2025
@mjbvz mjbvz removed their assignment May 22, 2025
@eps1lon
Copy link
Contributor

eps1lon commented May 23, 2025

Open a .tsx file in a solidjs project (probably any non-react project) and observe all JSX syntax triggers a typescript error masking other potential ts errors.

A SolidJS project without a properly configured tsconfig.json, right? tsc would report the same error.

@jcalfee
Copy link
Author

jcalfee commented May 23, 2025

Great question, I was wondering how I would narrow this down. I have something like a mono-repo where I point vscode to the root and vscode is smart enough to scan and pickup all the sub-projects directly in that folder (big help). In the case above, that folder does have a tsconfig.json as follows. Other projects use pnpm link to reference that project so they have "ipweb": "link:../ipweb" in their package.json.

{
  "compilerOptions": {
    "allowJs": true,
    "checkJs": true,
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true,
    "target": "ESNext",
    "module": "ESNext",
    "moduleResolution": "node",
    "jsxImportSource": "solid-js",
    "jsx": "preserve",
    "strictNullChecks": true,
    "exactOptionalPropertyTypes": true,
    "allowImportingTsExtensions": true,
    "noEmit": true,
    "baseUrl": "./",
    "paths": {
      "ipweb/*": ["*"]
    }
  },
  "exclude": [".archive", "**/.archive/*"],
  "include": ["src", "server", "./vite-env.d.ts"]
}

After my testing above (upgrading and downgrading), I eventually opened more files from a referencing project and the issue did not appear. So, I was able to upgrade back up to vscode 1.100 and so far so good. I'm not sure how to recreate it. It just has a mind of its own and shows up from time to time. It has been rare until the other day when TS Restarts and VCode restarts did not fix it (so I though I should document it here). I'm not sure what fixed or caused it.

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

No branches or pull requests

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy