Nextjs export step no longer working when build runs
See original GitHub issueDescribe the bug
Export step no longer working when running netlify build
My build function is defined in my package.json as is suggested by nextJS documentation:
{
"build": "next build && next export",
}
It seems after version v11.6.0, the export command is skipped.
Steps to reproduce
Create a nextJS app with package.json defined as:
{
"build": "next build && next export",
}
Run netlify build
Configuration
[build.environment] NEXT_PUBLIC_IS_PR_PREVIEW = ‘false’ NODE_VERSION = ‘16’ [context.deploy-preview.environment] NEXT_PUBLIC_IS_PR_PREVIEW = ‘true’
[dev] targetPort=4200
Environment
System: OS: macOS 12.5.1 CPU: (10) arm64 Apple M1 Pro Memory: 112.98 MB / 16.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node Yarn: 1.22.15 - ~/.nvm/versions/node/v16.15.1/bin/yarn npm: 8.11.0 - ~/.nvm/versions/node/v16.15.1/bin/npm npmGlobalPackages: netlify-cli: 11.5.1
Issue Analytics
- State:
- Created a year ago
- Comments:6
Hey @tinfoil-knight, it sorted itself out after a few days. Once one of the packages was updated.
@m-jovanovic Sorry for the delayed response.
I tried this out today with
netlify-cli/12.0.11
&next/13.0.0
.npx create-next-app@latest
"build"
script inpackage.json
tonext build && next export
netlify.toml
file with:The static export is working for me. An
out
directory is created with all the files. Can you update bothnetlify-cli
&next
and see if you’re still experiencing the issue?