Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Module not found error with ffmpeg.wasm in Next.js app? #678

Unanswered
lancejpollard asked this question in Q&A
Discussion options

I am getting this in Next.js 14.11 canary:

./node_modules/.pnpm/@ffmpeg+ffmpeg@0.12.10/node_modules/@ffmpeg/ffmpeg/dist/esm/classes.js:104:27 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 console.error @ [root of the server]__4fd2df._.js:12197
Screenshot 2024年02月02日 at 1 56 56 PM

I followed along https://github.com/ffmpegwasm/ffmpeg.wasm/tree/main/apps/nextjs-app and https://ffmpegwasm.netlify.app/docs/getting-started/usage, and this happens when I try and load the Next.js app importing the modules. Any ideas?

You must be logged in to vote

Replies: 2 comments

Comment options

Update, I noticed the https://unpkg.com/browse/@ffmpeg/core@0.12.6/dist/umd/ is 0.12.6, so I downgraded to that for the node module @ffmpeg/ffmpeg, and it seems to load now, instead of 0.12.10.

Now that it's starting to load, the await ffmpeg.load function is not returning, given these toBlobUrls:

Those throw error pages in my Next.js, should I point to a real URL?

I changed it to be:

But it still not loading. Though when I visit that path in the browser, that is what I saved it as and it shows up.

You must be logged in to vote
0 replies
Comment options

update line 104 with:
Object(import.meta).url

That's what worked for me.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /