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

Local builds: netlify build followed by netlify deploy doesn't work with Next.js sites #2501

Open
rks118 opened this issue Jun 20, 2024 · 2 comments
Assignees

Comments

@rks118
Copy link

rks118 commented Jun 20, 2024

Local build (netlify build) will output _next in .next, but disappear immediately.

As a result, the website could not find js/css/image resources after I deployed(netlify deploy --prod) it.

Screen Record:

Screen.Recording.2024-06-20.at.18.20.39.mov

netlify.toml:

[build]
  command = "pnpm run build"
  publish = ".next"
 
[[plugins]]
  package = "@netlify/plugin-nextjs"
@orinokai
Copy link
Contributor

Unfortunately, netlify build followed by netlify deploy does not work for Next.js sites (due to the way the Next Runtime manipulates the build output). Please run netlify deploy --build to deploy the site successfully.

@orinokai orinokai self-assigned this Jun 20, 2024
@rks118
Copy link
Author

rks118 commented Jun 20, 2024

Yes.

I had run netlify build before netlify deploy

@linear linear bot added the Next.js label Aug 16, 2024
@linear linear bot changed the title netlify build don't output _next folder Local builds: netlify build followed by netlify deploy doesn't work with Next.js sites Aug 16, 2024
@linear linear bot added the CLI label Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants