Open htcongvn opened 1 year ago
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp
add the headers to your server response
This is the vite.config.ts
that should fix it:
export default {
server: {
headers: {
"Cross-Origin-Embedder-Policy": "require-corp",
"Cross-Origin-Opener-Policy": "same-origin",
}
}
}
@mattiaz9 can you provide me configuration for vue.config.js but it is causing issue in production again
configureWebpack: {
devServer: {
onBeforeSetupMiddleware: ({ app }) => {
app.use((_, res, next) => {
res.setHeader("Cross-Origin-Opener-Policy", "same-origin");
res.setHeader("Cross-Origin-Embedder-Policy", "require-corp");
next();
});
},
},
Also I don't wanna to hurt other third party apis like firebase storage
I added those headers and confirmed that they are being added in the Chrome dev console. However, I still get the "SharedArrayBuffer is not defined" error.
Update: I cleared the browser cache and that fixed it.
Cross-Origin-Opener-Policy: same-origin Cross-Origin-Embedder-Policy: require-corp
将标头添加到服务器响应
After adding, the iframe and server images cannot be accessed. How can I solve this problem
此外,我不想伤害其他第三方 API,例如 firebase 存储
After adding, the iframe and server images cannot be accessed. How can I solve this problem
Describe the bug
Set up a vanilla React Typescript based project using Vitejs.
Make up two React components RecordMessage that uses react-media-recorder-2, and Controller that uses @ffmpeg/ffmpeg.
The files are as below.
RecordMessage.tsx:
Controller.tsx:
vite.config.ts:
.env.production:
VITE_APP_PORT=4173
package.js:
To Reproduce Steps to reproduce the behavior:
Expected behavior ffmpeg-core and SharedArrayBuffer is defined as it was in "yarn dev" mode. And the browser console log should look like below:
Desktop (please complete the following information):