Closed
Description
Version
Volar: 1.8.3
TypeScript: 5.1.6
Steps to reproduce
- Clone https://github.com/sqal/volar-react-types-bug
- Make sure takeover mode is enabled (
@builtin
TypeScript and JavaScript Language Features extension is disabled) - Install dependencies
npm run i
- Open
apps/react-app/src/main.tsx
- You can run
npm run type-check
to verify there's no issue in my app
What is actually happening?
I see a lot of Typescript errors reported in my app that I shouldn't see, e.g.
Type 'Element' is not assignable to type 'ReactNode'.
What is expected?
No Typescript errors in react-app
since all the code is correct.
Any additional comments?
It looks like volar breaks @types/react
when I have installed vue
somewhere in my monorepo. Follow these steps to verify:
- Go to apps/vue-app and remove
vue
from the dependencies cd ../../ & npm i
- Restart volar's server or restart vscode
- Now everything works fine in my react-app, there's no issues