-
-
Notifications
You must be signed in to change notification settings - Fork 29
Description
Background:
I came across issue #274, but it was closed without resolving the problem, so I'm recreate this.
I've managed to resolve this on my own, but I believe it's still important to raise this issue.
Issue:
The error occurs with @ffprobe-installer/linux-x64/ffprobe. In my Next.js project, I am using both @ffprobe-installer and @ffmpeg-installer. However, after running next build, the @ffprobe-installer/linux-x64/ffprobe module is missing (it seems to be optimized out ?). Meanwhile, the similar module @ffmpeg-installer/linux-x64/ffmpeg remains intact.
This issue can be reproduced using the Dockerfile from the Next.js example: https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile
My Solution:
Instead of using the node_modules from the Next.js build result, I copied the node_modules directly from the deps stage.
After lines
https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile#L56-L58
add:
COPY --from=deps --chown=nextjs:nodejs /app/node_modules ./node_modules