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

Open
@jcalfee

Description

@jcalfee

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!

Activity

transferred this issue frommicrosoft/vscodeon May 22, 2025
removed their assignment
on May 22, 2025
eps1lon

eps1lon commented on May 23, 2025

@eps1lon
Contributor

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

jcalfee commented on May 23, 2025

@jcalfee
Author

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jcalfee@eps1lon@mjbvz

        Issue actions

          [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. · Issue #61756 · microsoft/TypeScript