Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I updated to next.js 15 and got an error. #793

Open
agent-Y opened this issue Nov 11, 2024 · 6 comments
Open

I updated to next.js 15 and got an error. #793

agent-Y opened this issue Nov 11, 2024 · 6 comments

Comments

@agent-Y
Copy link

agent-Y commented Nov 11, 2024

I get error at await ffmpeg.load();

Build Error
Next.js (15.0.1) out of date (learn more) (Turbopack)
Failed to compile

./node_modules/@ffmpeg/ffmpeg/dist/esm/classes.js:104:28
Module not found
  102 |         if (!this.#worker) {
  103 |             this.#worker = classWorkerURL ?
> 104 |                 new Worker(new URL(classWorkerURL, import.meta.url), {
      |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  105 |                     type: "module",
  106 |                 }) :
  107 |                 // We need to duplicated the code here to enable webpack

https://nextjs.org/docs/messages/module-not-found
This error occurred during the build process and can only be dismissed by fixing the error.
@mrblackoutz
Copy link

I’m experiencing the same issue here. It was already mentioned in this issue: #72397.

@interactda
Copy link

Is there anyway to work around this?

@jswhisperer
Copy link
Contributor

Haven't tested but looks like you need to declare ffmpeg as an external so it doesn't get bundled twice
https://webpack.js.org/configuration/externals/

@interactda
Copy link

Haven't tested but looks like you need to declare ffmpeg as an external so it doesn't get bundled twice https://webpack.js.org/configuration/externals/

I think the issue is with turbopack rather than webpack

@jswhisperer
Copy link
Contributor

@484Irgang
Copy link

484Irgang commented Jan 20, 2025

Same issue here. Unfortunately, setting this package as serverExternalPackage in next.config does not resolve the problem. I'm still encountering the following error:

./node_modules/@ffmpeg/ffmpeg/dist/esm/classes.js:104:28
Module not found: Can't resolve "< dynamic >"
102 | if (!this.#worker) {
103 | this.#worker = classWorkerURL ?
104 | new Worker(new URL(classWorkerURL, import.meta.url), {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
105 | type: "module",
106 | }) :
107 | // We need to duplicate the code here to enable webpack

As mentioned in this comment, it seems that import.meta.url is causing compatibility issues with Turbopack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants