Replies: 2 comments 2 replies
-
I had the exact same question! @hummingly Found any workaround in the time being? |
Beta Was this translation helpful? Give feedback.
2 replies
-
This is my workaround: // snowpack.config.js
const fs = require("fs");
module.exports = {
routes: [
{
match: "routes",
src: ".*",
dest: (req, res) => {
// Default headers. See https://github.com/withastro/snowpack/blob/c44d86f73ac7b74507d4d5554ccb96e8b7dc5294/snowpack/src/commands/dev.ts#L133-L137.
res.setHeader("Accept-Ranges", "bytes");
res.setHeader("Access-Control-Allow-Origin", "*");
res.setHeader("Content-Type", "text/html");
res.setHeader("Vary", "Accept-Encoding");
// Make `index.html` cross-origin isolated to enable `SharedArrayBuffer`.
res.setHeader("Cross-Origin-Embedder-Policy", "require-corp");
res.setHeader("Cross-Origin-Opener-Policy", "same-origin");
return fs.createReadStream("index.html").pipe(res);
},
},
],
}; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone!
Using snowpack has been a joy so far but I run into the issue that I need to set the headers of the dev server in order to use SharedArrayBuffer. At the moment SharedArrayBuffer can be only used without cross origin isolation on Chrome Desktop until version 91 or so.
The headers are
If that is not possible I either have to setup my own dev server but I would like to avoid that.
Beta Was this translation helpful? Give feedback.
All reactions