Skip to content

fix(nextjs): copy public/ into the standalone output - #683

Merged
leoortizz merged 1 commit into
mainfrom
fix/nextjs-public
Aug 31, 2026
Merged

leoortizz merged 1 commit into
mainfrom
fix/nextjs-public

Conversation

@leoortizz

Copy link
Copy Markdown
Member

Next's standalone output only contains the public files it traced, and
copyResources() skips a top-level entry that already exists in the output
bundle -- so the rest of public/ was dropped and 404'd in production.

Copy public/ explicitly, merging per file. copyResources() no longer handles it.

Fixes #630

Next's standalone output only contains the public files it traced, and
copyResources() skips a top-level entry that already exists in the output
bundle -- so the rest of public/ was dropped and 404'd in production.

Copy public/ explicitly, merging per file. copyResources() no longer handles it.

Fixes #630

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Next.js adapter to reliably copy and merge the application's public directory into the standalone output directory, addressing cases where Next.js' standalone output is missing or only partially populated. It introduces a new copyPublicDirectory function, updates resource copying logic to prevent duplicate handling of the public directory, and adds corresponding unit and end-to-end tests. There are no review comments, and I have no additional feedback to provide.

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

Successfully merging this pull request may close these issues.

adapter-nextjs: all public/ assets 404 in production with webpack standalone builds (monorepo) — no bundler-independent public copy

2 participants