-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Closed
Description
Describe the bug
The vite/client types result in type errors when used in sources where lib was declared to be webworker. It runs fine in vite but throws errors when validating via tsc.
Reproduction
git clone https://github.com/lgrahl/vite-client-in-worker
cd vite-client-in-worker
npm install
npx tsc --noEmit -p src/app/tsconfig.json; npx tsc --noEmit -p src/worker/tsconfig.jsonAnalysis
The issue is that vite/client is referencing DOM (see vite/client.d.ts) which is a superset of what workers can do. However, AFAICT vite/client doesn't need that superset.
Related: microsoft/TypeScript#20595
Before submitting the issue, please make sure you do the following
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Provide a description in this issue that describes the bug.
- 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 https://github.com/vuejs/vue-next instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
Reactions are currently unavailable