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

Upgrading to @types/react@v19+ and @types/react-dom@v19+ cannot find namespace 'JSX' #1282

Open
chris-dura opened this issue Jan 27, 2025 · 0 comments

Comments

@chris-dura
Copy link

I have a boilerplate project setup using tsup and react@v19...

  "dependencies": {
    "react": "^19.0.0",
    "react-dom": "^19.0.0"
  },
  "devDependencies": {
    "@repo/eslint-config": "*",
    "@repo/release-it-config": "*",
    "@repo/typescript-config": "*",
    "@types/react": "18.3.14",
    "@types/react-dom": "18.3.2",
    "eslint": "^9.18.0",
    "tsup": "^8.3.5",
    "typescript": "^5.7.3"
  },

But, when I try to upgrade the @types/react and @types/react-dom, tsup throws a TS2503: Cannot find namespace 'JSX' error.

...
DTS Build start
│ src/button.tsx(6,62): error TS2503: Cannot find namespace 'JSX'.
│ 
│ Error: error occurred in dts build
│     at Worker.<anonymous> (/Users/code/my-project/node_modules/tsup/dist/index.js:1541:26)
│     at Worker.emit (node:events:524:28)
│     at MessagePort.<anonymous> (node:internal/worker:267:53)
│     at [nodejs.internal.kHybridDispatch] (node:internal/event_target:827:20)
│     at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28)
│ DTS Build error
│ npm error Lifecycle script `build` failed with error:
│ npm error code 1
│ npm error path /Users/code/my-project/packages/lib
│ npm error workspace [email protected]
│ npm error location /Users/code/my-project/packages/lib
│ npm error command failed
│ npm error command sh -c tsup
│ 
│ command finished with error: command (/Users/code/my-project/packages/lib) /Users/P2185561/.nvm/versions/node/v22.13.1/bin/npm run build exited (1)
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

1 participant