You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using @vitejs/plugin-react@4.0.4, I get this error when building my application:
I can get rid of this error by installing @types/babel__core, but I don't think it should be the user's responsibility to install a type on which a dependency depends.
node_modules/@vitejs/plugin-react/dist/index.d.ts:1:49 - error TS7016: Could not find a declaration file for module '@babel/core'. '/node_modules/@babel/core/lib/index.js' implicitly has an 'any' type.
Try npm i --save-dev @types/babel__core if it exists or add a new declaration (.d.ts) file containing declare module '@babel/core';
1 import { TransformOptions, ParserOptions } from '@babel/core';
~~~~~~~~~~~~~
This is because you don't have skipLibCheck enabled in your tsconfig. This is very common and given that the first time it's been reported since the repo was split 7 months ago, this is even more common than I would expect.
Nonetheless maybe there is some usage of the plugin in vite.config.ts that is badly typed. I will look into it.
Checking lib types can help find issues in the libs you use but most of the time this is unactionable and this is why most template enable this TS flag.
I would rather not enable skipLibCheck is my tsconfig as it helps me find inconsistencies with the versions of the libs I use (e.g. if I end up with two different version of @types/react in my yarn.lock).
I'm looking forward the result of your investigations, thank you.
Describe the bug
When using
@vitejs/plugin-react
@4.0.4, I get this error when building my application:I can get rid of this error by installing
@types/babel__core
, but I don't think it should be the user's responsibility to install a type on which a dependency depends.Reproduction
https://github.com/saramorillon/inventory/tree/b612b372734dda6454872427a76b037050d50ed9
Steps to reproduce
In
front
directory, runyarn install
followed byyarn build
System Info
Used Package Manager
yarn
Logs
node_modules/@vitejs/plugin-react/dist/index.d.ts:1:49 - error TS7016: Could not find a declaration file for module '@babel/core'. '/node_modules/@babel/core/lib/index.js' implicitly has an 'any' type.
Try
npm i --save-dev @types/babel__core
if it exists or add a new declaration (.d.ts) file containingdeclare module '@babel/core';
1 import { TransformOptions, ParserOptions } from '@babel/core';
~~~~~~~~~~~~~
Found 1 error.
error Command failed with exit code 1.
Validations
The text was updated successfully, but these errors were encountered: