We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
⚠️ IMPORTANT ⚠️ Please check the following list before proceeding. If you ignore this issue template, your issue will be directly closed.
Vite does not handle TypeScript file as worker source.
Error: Invalid loader: "ts?worker&inline" (valid: js, jsx, ts, tsx, css, json, text, base64, dataurl, file, binary)
my-worker.js
my-worker.ts
lang="ts"
index.html
yarn dev
vite
vite:esbuild esbuild error with options used: { loader: 'ts?worker&inline', sourcemap: true, sourcefile: '/c/dev/vite/packages/playground/worker/my-worker.ts?worker&inline' } [vite] Internal server error: Plugin: vite:esbuild File: /c/dev/vite/packages/playground/worker/my-worker.ts?worker&inline Error: Invalid loader: "ts?worker&inline" (valid: js, jsx, ts, tsx, css, json, text, base64, dataurl, file, binary) at /c/dev/vite/node_modules/esbuild/lib/main.js:843:33 at handleIncomingPacket (/c/dev/vite/node_modules/esbuild/lib/main.js:563:9) at Socket.readFromStdout (/c/dev/vite/node_modules/esbuild/lib/main.js:481:7) at Socket.emit (events.js:315:20) at addChunk (_stream_readable.js:302:12) at readableAddChunk (_stream_readable.js:278:9) at Socket.Readable.push (_stream_readable.js:217:10) at Pipe.onStreamRead (internal/stream_base_commons.js:186:23) vite:time 64ms /my-worker.ts?worker&inline +65ms vite:esbuild esbuild error with options used: { loader: 'ts?worker', sourcemap: true, sourcefile: '/c/dev/vite/packages/playground/worker/my-worker.ts?worker' } +37ms [vite] Internal server error: Plugin: vite:esbuild File: /c/dev/vite/packages/playground/worker/my-worker.ts?worker Error: Invalid loader: "ts?worker" (valid: js, jsx, ts, tsx, css, json, text, base64, dataurl, file, binary) at /c/dev/vite/node_modules/esbuild/lib/main.js:843:33 at handleIncomingPacket (/c/dev/vite/node_modules/esbuild/lib/main.js:563:9) at Socket.readFromStdout (/c/dev/vite/node_modules/esbuild/lib/main.js:481:7) at Socket.emit (events.js:315:20) at addChunk (_stream_readable.js:302:12) at readableAddChunk (_stream_readable.js:278:9) at Socket.Readable.push (_stream_readable.js:217:10) at Pipe.onStreamRead (internal/stream_base_commons.js:186:23) vite:time 71ms /my-worker.ts?worker +11ms
The text was updated successfully, but these errors were encountered:
e09bf25
fix: properly handle ts worker source
eea1224
fix #1385
No branches or pull requests
Describe the bug
Vite does not handle TypeScript file as worker source.
Reproduction
my-worker.js
tomy-worker.ts
lang="ts"
toindex.html
script tagyarn dev
System Info
vite
version: 2.0.0-beta.8Logs (Optional if provided reproduction)
The text was updated successfully, but these errors were encountered: