-
Notifications
You must be signed in to change notification settings - Fork 86
isStaticExport logic fails if the build command doesn't contain "next export" #503
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
Comments
Well found! That's a really good point: we need a more robust way of detecting which scripts are run. I'll look at that today. The addition of an env var to disable all plugin auto install is a really good idea too. I'll raise that with the team. |
hi @ascorbic, looks like the issue is back for us in 4.0.0, breaking all our sites :)
package.json:
The problem is that the next.js plugin is auto-installed and breaks the build with this:
Is there a way to make sure that the plugin doesn't auto-install? |
Good point. There isn't a way to disable auto-install, but I could add an env var to disable everything except caching. Would that work for you? |
@ascorbic that would be amazing, thanks, Matt! |
This is borderlining between a bug and feature request :)
Describe the bug
We had the plugin start failing recently. What ended up happening is that the isStaticExport wasn't detected anymore.
To Reproduce
Steps to reproduce the behavior:
"build: next build"
and"export: next export"
to your package.json."netlify:build": "npm run build && npm run export"
This is due to "next export" not found in the build command string.
Expected behavior
This could be a fragile way of detecting whether the plugin should run or not. Since there doesn't seem to be a way to opt out of the plugin install, I think it's worth reviewing the approach here.
Option 1: Provide more flexibility to detect the static build
Option 2: Provide a way to opt out of having the plugin to auto-install at all (I think many will prefer having this option in an env var or something)
Versions
The text was updated successfully, but these errors were encountered: