Local builds: `netlify build` followed by `netlify deploy` doesn't work with Next.js sites
Opened this issue · 2 comments
rks118 commented
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 commented
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.
rks118 commented
Yes.
I had run netlify build
before netlify deploy