Skip to content

How to set HTTP headers for WebWorker files in Gatsby dev environment? #34995

Discussion options

You must be logged in to vote

@ospfranco Back when I was using Gatsby v5.12.12, I solved this using the custom plugin below.

I've since migrated to Next.js, where enabling this behavior only requires a few lines in next.config.js. I can't guarantee that this solution still works with the latest Gatsby versions.

  1. Create a plugins folder in your project root, if it doesn't already exist

  2. Inside plugins, create a folder for the custom plugin called gatsby-plugin-dev-server-sharedarraybuffer-header

  3. Add a package.json file with the following content to that folder:

{
  "name": "gatsby-plugin-dev-server-sharedarraybuffer-header",
  "private": true,
  "sideEffects": true,
  "engines": {
    "node": ">=14.0.0"
  }
}
  1. Cr…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by jens-duttke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants