ffmpegwasm/ffmpeg.wasm

FFmpeg.wasm does not seem to work on the Edge Runtime of Next.js.

ybd-project opened this issue · 0 comments

Describe the bug
In Next.js, when I set the runtime to Edge, I get the following error and it does not work.

⨯ Error [ReferenceError]: document is not defined
    at <unknown> (.next\server\edge-runtime-webpack.js:633)
    at <unknown> (.next\server\edge-runtime-webpack.js:633:36)
    at <unknown> (.next\server\edge-runtime-webpack.js:1168:13)
    at <unknown> (.next\server\edge-runtime-webpack.js:1174:12)

To Reproduce
Just add export const runtime = 'edge'; to the Next.js example to reproduce the bug.
I add export const runtime = 'edge'; to layout.tsx to make all pages Edge runtime.

Expected behavior
The page should be generated normally and no errors should occur.

Screenshots
Image

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser Google Chrome
  • Version 132