-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
vite config files can't be compiled without dom
types
#9813
Comments
I think adding the following code will work. declare global {
interface Worker {}
namespace WebAssembly {
interface Module {}
}
} |
this issue also seems to be present in the opposite scenario. when using vite types in the browser, it relies on |
…ribed and will remove when they fix
I can confirm, that I cannot typecheck my project with My project(s) are in a monorepo with npm. Excluding node_modules in my A workaround that helped me, was to // vitest.d.ts
declare interface Worker {}
declare interface WebSocket {}
declare namespace WebAssembly {
interface Module {}
} |
Describe the bug
when attempting to compile a
vite.config.ts
file without dom types, and withoutskipLibCheck
intsconfig.json
, the following errors occur:i believe it's because these types are defined globally in
lib.dom.d.ts
. but since thevite.config.ts
file is executed by nodejs, it's incorrect to include the dom types when compiling it.is it possible to resolve this by importing the
Worker
type from elsewhere?Reproduction
https://stackblitz.com/edit/vitejs-vite-ghpgs3?file=vite.config.ts,tsconfig.json,package.json&terminal=dev
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: