Skip to content

fix: GitHub Pages deploy fails — out directory missing after next build#252

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-action-job-failure
Draft

fix: GitHub Pages deploy fails — out directory missing after next build#252
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-action-job-failure

Conversation

Copilot AI commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

The "Deploy React App to GitHub Pages" workflow was failing at the export step because next build without output: 'export' produces .next/, not out/, which scripts/export.js requires.

Changes

  • next.config.js — Add output: 'export' to the GitHub Pages production config block so next build emits out/
...(isProd && isGitHubPages && {
  output: 'export',
  basePath: '/Reminders',
  assetPrefix: '/Reminders/',
  images: { unoptimized: true }
}),
  • /reminder/[id]/page.tsx — Next.js 15 throws if a dynamic route returns an empty generateStaticParams with output: 'export'. Return a placeholder path and set dynamicParams = false so unknown IDs fall through to the SPA 404 fallback (public/404.html) for client-side routing.
export const dynamicParams = false;

export function generateStaticParams() {
  // Next.js 15 requires at least one path for dynamic routes with `output: 'export'`.
  // Real IDs are loaded client-side; unknown paths are handled via the SPA 404 fallback.
  return [{ id: 'placeholder' }];
}
Original prompt

Reference: https://github.com/KaueReinbold/Reminders/actions/runs/22305278362/job/64522807367


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

… Pages deploy

Co-authored-by: KaueReinbold <22650820+KaueReinbold@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix action job failure in CI/CD pipeline fix: GitHub Pages deploy fails — out directory missing after next build Feb 23, 2026
Copilot AI requested a review from jumperck February 23, 2026 12:21
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.

2 participants