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

fail build if plugin cant load next.config.js #99

Merged
merged 2 commits into from
Feb 17, 2021

Conversation

lindsaylevine
Copy link

Fixes #78
Fixes #79

not 100% sure about trying to pass in the exact error from the catch into failBuild, open to thoughts!

@lindsaylevine lindsaylevine added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Feb 17, 2021
Copy link

@erezrokah erezrokah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 For more error handling.

I think we should pass the original error as suggested here to make it easier for users to self serve

@@ -5,15 +5,15 @@ const isStaticExportProject = require('./isStaticExportProject')
const doesSiteUseNextOnNetlify = require('./doesSiteUseNextOnNetlify')
const hasCorrectNextConfig = require('./hasCorrectNextConfig')

const doesNotNeedPlugin = async ({ netlifyConfig, packageJson }) => {
const doesNotNeedPlugin = async ({ netlifyConfig, packageJson, utils }) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[dust] should we pass only failBuild

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i was trying to keep it on the same level as netlifyConfig and packageJson, as in they're all things that get passed to the different event handlers (i.e onBuild) so i think it's ok? will keep in mind tho going forward

Copy link

@ehmicky ehmicky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @lindsaylevine!

@lindsaylevine lindsaylevine merged commit 3d21384 into main Feb 17, 2021
@lindsaylevine lindsaylevine deleted the ll/next-config-loading branch February 17, 2021 23:24
lindsaylevine added a commit that referenced this pull request Feb 18, 2021
- fail build if plugin cant load next.config.js ([#99](#99))
- chore: decrease package size ([#101](#101))
- remove Next as a peer dependency ([#96](#96))
- update failure points in plugin to do nothing instead ([#94](#94))
serhalp pushed a commit that referenced this pull request Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle errors when loading next.config.js Missing require() in next.config.js
3 participants