ffmpegwasm / ffmpegwasm/ffmpeg.wasm

Because your site has the Cross-Origin Embedder Policy enabled, each embedded iframe must also specify this policy

Open
#614 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
17.8k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

Next.js 13 app deployed using Amplify: https://main.d2hzcewjwit905.amplifyapp.com

When trying to convert a file, a request is made to https://main.d2hzcewjwit905.amplifyapp.com/_next/static/chunks/795.ceab62a43c56068c.js which gives the following error:

![image](https://github.com/aws-amplify/amplify-hosting/assets/48166845/1cf5ca7d-e6cd-4dcb-a0c0-ba173396d755)

I'm not sure how to resolve this. I have set `Cross-Origin-Embedder-Policy` to `require-corp` for all paths in `next.config.js` (unless `source: "/(.*)"` doesn't match all paths? I tried `source: "/"` too and got the same issue).

```
async headers() {
return [
{
source: "/(.*)",
headers: [
{
key: "Cross-Origin-Embedder-Policy",
value: "require-corp",
},
{
key: "Cross-Origin-Opener-Policy",
value: "same-origin",
},
{
key: "Access-Control-Allow-Origin",
value: "*",
},
],
},
];
},
```

The source code for my project which includes my `next.config.js` file can be found here: https://github.com/CrypticSignal/av-converter-amplify

### Reproduction steps

1. Go to https://main.d2hzcewjwit905.amplifyapp.com
2. Open devtools and go to the network tab
3. Try to convert a file
4. After a few seconds, you should see a request being made to https://main.d2hzcewjwit905.amplifyapp.com/_next/static/chunks/795.ceab62a43c56068c.js and the error in the screenshot above.

- **OS:** Windows 11
- **Browser:** Chrome v117.0.5938.149 (Official Build) (64-bit)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.