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

build --watch doesnt build workers (new Worker(new URL())) #14435

Closed
7 tasks done
spencerchubb opened this issue Sep 21, 2023 · 1 comment · Fixed by #14712
Closed
7 tasks done

build --watch doesnt build workers (new Worker(new URL())) #14435

spencerchubb opened this issue Sep 21, 2023 · 1 comment · Fixed by #14712
Labels
feat: hmr feat: web workers p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@spencerchubb
Copy link

spencerchubb commented Sep 21, 2023

Describe the bug

I have a library that uses workers and wasm. When I build the first time, it works perfectly, but when it hot-reloads it gives an error.

I have included a minimal example that uses the vite starter template and only adds a couple lines of code to demo the issue.

Reproduction

https://github.com/spencerchubb/hot-reload-bug.git

Steps to reproduce

git clone https://github.com/spencerchubb/hot-reload-bug.git
cd hot-reload-bug
npm i
npx vite build --watch
npx vite preview

# If you open localhost:5000 there are no errors in the console.
# Now do some arbitrary change to trigger the hot-reload.
# After a hot-reload, there will be an error in the console.

System Info

Windows, Chrome

Used Package Manager

npm

Logs

message: "Uncaught SyntaxError: Unexpected token '<'"

Validations

@sapphi-red sapphi-red changed the title Hot reload with workers + wasm build --watch doesnt build workers (new Worker(new URL())) Sep 27, 2023
@sapphi-red sapphi-red added the p3-minor-bug An edge case that only affects very specific usage (priority) label Sep 27, 2023
@sapphi-red
Copy link
Member

related: #11786, #11919

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feat: hmr feat: web workers p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants