https://cypress.io logo
Headers for SharedArrayBuffer
# i-need-help
d
Our application makes use of SharedArrayBuffer, which requires the following headers to be added to the server:
Copy code
"Cross-Origin-Opener-Policy", "same-origin"
"Cross-Origin-Embedder-Policy", "require-corp"
Without the headers, when attempting to run tests in Chrome, the following error appears:
Copy code
(uncaught exception) ReferenceError:
SharedArrayBuffer is not defined
In Cypress 10 (specifically 10.3.1), we placed these headers in the following file: Cypress/10.3.1/Cypress/resouces/app/packages/server/lib/server-base.js. This allowed us to run tests in Chrome successfully. However, we have migrated to Cypress 12.4.0, which does not seem to have this file. Where should the headers be placed in Cypress 12.4.0? We added the flag enable-features=SharedArrayBuffer to the launch options in cypress.config.ts, but it either negates or is negated by the other two flags needed to enable visualization in our app (enable-features=Vulkan and enable-unsafe-webgu) depending on which order the flags are set, so we cannot use the flag.