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

basePath not creating structure correctly when output set to export #67817

Open
robmarshall opened this issue Jul 16, 2024 · 0 comments
Open
Labels
bug Issue was opened via the bug report template. Output (export/standalone) Related to the the output option in `next.config.js`.

Comments

@robmarshall
Copy link

Link to the code that reproduces this issue

https://github.com/robmarshall/next-output-export-reproduce

To Reproduce

  1. Start application using Next Build
  2. Serve the application (npx serve out)

Current vs. Expected behavior

The page.tsx file at root level should be returned at: "/app".
However it is only shown at "/" with all of its imports (styling/fav etc) broken - trying to find files at "/app".

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 10 Home
  Available memory (MB): 32653
  Available CPU cores: 8
Binaries:
  Node: 18.17.0
  npm: N/A
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 14.2.5 // Latest available version is detected (14.2.5).
  eslint-config-next: 14.2.5
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.5.3
Next.js Config:
  output: export

Which area(s) are affected? (Select all that apply)

Output (export/standalone)

Which stage(s) are affected? (Select all that apply)

next dev (local), next build (local), next start (local), Vercel (Deployed)

Additional context

When removing the output key from the Next config, and building as a standard Next app, the routing works correctly.

Next Config:

const nextConfig = {
  images: {
    unoptimized: true,
  },
  basePath: "/app",
  trailingSlash: true,
  output: "export",
};
@robmarshall robmarshall added the bug Issue was opened via the bug report template. label Jul 16, 2024
@github-actions github-actions bot added the Output (export/standalone) Related to the the output option in `next.config.js`. label Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. Output (export/standalone) Related to the the output option in `next.config.js`.
Projects
None yet
Development

No branches or pull requests

1 participant