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

Build fails because of missing type definitions #1076

Closed
6 tasks done
MantasSutkevicius opened this issue Apr 2, 2022 · 4 comments · Fixed by #1474
Closed
6 tasks done

Build fails because of missing type definitions #1076

MantasSutkevicius opened this issue Apr 2, 2022 · 4 comments · Fixed by #1474

Comments

@MantasSutkevicius
Copy link

MantasSutkevicius commented Apr 2, 2022

Describe the bug

Whenever I add a test to the project and try to run npm run build, I get type definition errors. Errors are related to @types/node and @types/ws. I know I could just install these within my own devDependencies, but I think this should not be the case?

image

image

Reproduction

This is a fresh install of Vite+Vitest. The only change by me here is adding a test. Try running npm run build here:
https://stackblitz.com/edit/vitejs-vite-kmvhms

System Info

-

Used Package Manager

npm

Validations

@sheremet-va
Copy link
Member

Not sure about "@types/ws", but "@types/node" is required

You can also try passing "--skipLibCheck" to tsc command

@MantasSutkevicius
Copy link
Author

I know that skipLibCheck solves the issue, but I would rather keep the rule as true. I think I'll just install these deps on my own.

@david-crespo
Copy link
Contributor

I'm also running into this when adding Vitest to a project. Had to add @types/ws and @types/babel__core. Will update if I find an alternative. It's a bit weird.

@sheremet-va sheremet-va reopened this Apr 5, 2022
@sheremet-va
Copy link
Member

Can confirm the bug: https://github.com/sheremet-va/vitest-types-bug

Note, we also require esModuleInterop: true in tsconfig at the moment (because of chai)

@sheremet-va sheremet-va added bug and removed question labels Jun 13, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jun 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants