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

Cannot load WebWorker when deployed to Vercel #24616

Closed
jhaynie opened this issue Apr 29, 2021 · 2 comments
Closed

Cannot load WebWorker when deployed to Vercel #24616

jhaynie opened this issue Apr 29, 2021 · 2 comments
Labels
bug Issue was opened via the bug report template.

Comments

@jhaynie
Copy link

jhaynie commented Apr 29, 2021

What version of Next.js are you using?

10.2.0

What version of Node.js are you using?

14.16.1

What browser are you using?

Chrome

What operating system are you using?

macOS

How are you deploying your application?

Vercel

Describe the Bug

Cannot use WebWorkers in latest version of next.js. Support is broken when running in Vercel cloud. I can't tell if it's Webpack 5, Babel or Next but it seems to be related to the contenthash rule of the output filename.

It works locally in dev, but deployed to Vercel causes a 404 for the worker file.

Expected Behavior

Expect it to load the worker.

To Reproduce

I've created a minimal NextJS 10.2 example repo that reproduces the bug (and demonstrates a workaround):

https://github.com/jhaynie/nextjs-webworker-bug

This is deployed to vercel at

https://nextjs-webworker-bug.vercel.app/

If you change [contenthash] to [fullhash] in webpack, it works.

config.output.chunkFilename = "static/chunks/[name].[fullhash].js";
@jhaynie jhaynie added the bug Issue was opened via the bug report template. label Apr 29, 2021
@ijjk
Copy link
Member

ijjk commented Apr 29, 2021

Duplicate of #22813

@ijjk ijjk closed this as completed Apr 29, 2021
@ijjk ijjk marked this as a duplicate of #22813 Apr 30, 2021
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

3 participants