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
This is a problem because types/importGlob references a global Worker variable that doesn't exist in @types/node (which is an optional dependency of Vite). WebSocket has the same problem. Ideally, we should have a separate shared file from which these options can be imported. Or they can also just be inlined in the vite entrypoint.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Describe the bug
When using
vite
with TypeScript that doesn't referencedom
lib, type checking gives an error:This happens because
vite
exports typeGeneralImportGlobOptions
from itsvite
entry:vite/packages/vite/src/node/plugins/importMetaGlob.ts
Line 21 in 91a18c2
This is a problem because
types/importGlob
references a global Worker variable that doesn't exist in@types/node
(which is an optional dependency of Vite).WebSocket
has the same problem. Ideally, we should have a separate shared file from which these options can be imported. Or they can also just be inlined in thevite
entrypoint.Reproduction
https://stackblitz.com/edit/node-rygrfb?file=tsconfig.json,index.ts,package.json
Steps to reproduce
pnpm run test
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: