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

Static export of simple nextjs project doesn't seem to work #51737

Closed
1 task done
ishaanjain opened this issue Jun 24, 2023 · 2 comments
Closed
1 task done

Static export of simple nextjs project doesn't seem to work #51737

ishaanjain opened this issue Jun 24, 2023 · 2 comments
Labels
not stale A previously `stale` marked issue that is no longer stale. Output Related to the the output configuration option.

Comments

@ishaanjain
Copy link

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
      Platform: darwin
      Arch: x64
      Version: Darwin Kernel Version 22.3.0: Thu Jan  5 20:53:49 PST 2023; root:xnu-8792.81.2~2/RELEASE_X86_64
    Binaries:
      Node: 20.3.1
      npm: 9.6.7
      Yarn: N/A
      pnpm: N/A
    Relevant Packages:
      next: 13.4.8-canary.2
      eslint-config-next: N/A
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 4.9.5
    Next.js Config:
      output: export

Which area(s) of Next.js are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue or a replay of the bug

https://github.com/ishaanjain/reproduction-app

To Reproduce

Clone the repo, run npm run build, and then open /out/index.html in the browser.

Describe the Bug

In the browser console, a bunch of errors are shown regarding not being able to access supporting files. In addition, the html elements (basically just an empty canvas element) do not load and the website is completely blank.

If I enable server-side rendering (which is the default nextjs behavior), then the canvas element loads but the network errors still appear.

Expected Behavior

I expect the out/index.html generated by npm run build (with output: 'export' in next.config.js) to properly display the website when opened in the browser.

Which browser are you using? (if relevant)

Chrome 114.0.5735.133

How are you deploying your application? (if relevant)

No response

@ishaanjain ishaanjain added the bug Issue was opened via the bug report template. label Jun 24, 2023
@nextjs-bot
Copy link
Collaborator

This issue has been automatically marked as stale due to two years of inactivity. It will be closed in 7 days unless there’s further input. If you believe this issue is still relevant, please leave a comment or provide updated details. Thank you.

@nextjs-bot nextjs-bot added the stale The issue has not seen recent activity. label Feb 16, 2025
@nextjs-bot nextjs-bot added not stale A previously `stale` marked issue that is no longer stale. and removed stale The issue has not seen recent activity. labels Feb 24, 2025
@samcx samcx removed the bug Issue was opened via the bug report template. label Feb 25, 2025
@samcx
Copy link
Member

samcx commented Feb 25, 2025

@ishaanjain It's likely you forgot to use the cp commands.

cp -r public .next/standalone/ && cp -r .next/static .next/standalone/.next/

Closing since that was likely the issue!

@samcx samcx closed this as completed Feb 25, 2025
@samcx samcx added the Output Related to the the output configuration option. label Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not stale A previously `stale` marked issue that is no longer stale. Output Related to the the output configuration option.
Projects
None yet
Development

No branches or pull requests

4 participants
@ishaanjain @samcx @nextjs-bot and others