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

Does not handle TypeScript file as worker source #1385

Closed
3 tasks done
Alex-D opened this issue Jan 6, 2021 · 0 comments
Closed
3 tasks done

Does not handle TypeScript file as worker source #1385

Alex-D opened this issue Jan 6, 2021 · 0 comments

Comments

@Alex-D
Copy link

Alex-D commented Jan 6, 2021

⚠️ IMPORTANT ⚠️ Please check the following list before proceeding. If you ignore this issue template, your issue will be directly closed.

  • Read the docs.
  • Use Vite >=2.0. (1.x is no longer supported)
  • If the issue is related to 1.x -> 2.0 upgrade, read the Migration Guide first.

Describe the bug

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)

Reproduction

System Info

  • vite version: 2.0.0-beta.8
  • Operating System: WSL on Windows 10
  • Node version: 14.4.0
  • Package manager (npm/yarn/pnpm) and version: yarn 1.22.5 / npm 6.14.10

Logs (Optional if provided reproduction)

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
yyx990803 added a commit that referenced this issue Jan 6, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant