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

Literate modules can't be loaded as Web Workers in Vite #8

Closed
egasimus opened this issue Jan 1, 2022 · 2 comments
Closed

Literate modules can't be loaded as Web Workers in Vite #8

egasimus opened this issue Jan 1, 2022 · 2 comments

Comments

@egasimus
Copy link
Collaborator

egasimus commented Jan 1, 2022

They fail silently in dev mode; vite build returns a very unhelpful error message.
The Rollup plugin that allows literate modules to be used in VIte at all seems to be tripped up by the ?worker suffix that is used to trigger Vite's Web Worker plugin.

@egasimus
Copy link
Collaborator Author

egasimus commented Jan 2, 2022

Root cause:
vitejs/vite#6191

Resolution:
vitejs/vite#6243
https://github.com/poyoho/vite/tree/fix/worker-with-plugin

Blocker:
Adding Vite as a submodule fails with various funny errors, such as:

SyntaxError: Cannot use import statement outside a module

and, after adding "type": "module" to the Vite workspace's package.json:

TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /home/user/Lab/5/takovata/vite/scripts/patchFileDeps.ts

even though the postinstall hook is literally ts-node ../../../scripts/patchFileDeps.ts.

@egasimus
Copy link
Collaborator Author

egasimus commented Jan 2, 2022

vitejs/vite#6351 just merged, waiting for new release to see if that fixes it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant