-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
fix(api-runner-node): build should stop on error #4347
Conversation
8ad0f34
to
9a38850
Compare
Deploy preview for gatsbygram ready! Built with commit 8ad0f3446efd950a5685839aaa5e45bb5890eac9 |
Deploy preview for gatsbygram ready! Built with commit 195e96c |
@@ -161,7 +161,7 @@ module.exports = async (api, args = {}, pluginSource) => | |||
}, | |||
(err, results) => { | |||
if (err) { | |||
reporter.error(`${pluginName} returned an error`, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since panicOnBuild
doesn't exist, you can do the same thing by adding a conditional if (process.env.NODE_ENV === "production") { /* panic */ } else { /* error */ }
If a plugin throws an error, the build should stop and exit with an error exit code, not just log the error and continue the build.
9a38850
to
5eb8c09
Compare
@KyleAMathews Thanks, good point! I saw you closed the issue related to v2, but maybe we can still get this out as a fix? |
Yup, happy to publish this work around. Thanks for PRing it! Check out TravisCI — there's a lint error. |
@KyleAMathews Thanks for the hint and sorry for the time consuming back and forth. Ready for merge imo. |
Thanks! |
Hiya @anjawaldbauer! 👋 This is definitely late, but on behalf of the entire Gatsby community, I wanted to say thank you for being here. Gatsby is built by awesome people like you. Let us say “thanks” in two ways:
If you have questions, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’. Thanks again! 💪💜 |
If a plugin throws an error, the build should stop and exit with an error exit code, not just log the error and continue the build.
Possibly related to #4070