-
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
Improve error messages of createPage
API
#3357
Comments
Great idea! Probably the best approach here would be to add schema validation in Joi -- possibly only in dev mode? -- for inputs on the createPage function: https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/redux/actions.js eg https://github.com/hapijs/joi/blob/master/examples/customMessage.js Re priority, we're heavily into making Gatsby an awesome experience! we'd love a PRs on this @arun1595 or anyone else who is interested |
@calcsam I would like to work on this issue. |
@GregBorrelly it's yours -- i'll add you to the core team (check your email in the morning) and assign it to you! |
@GregBorrelly thanks for taking this on! |
Thank you @calcsam !!!! |
@calcsam Status update: working on the issue, I got stuck migrating an app at work so that took a while. |
Oh actually did a PR for this already 😅 forgot to close out this issue. @GregBorrelly can you upgrade to master and tell me what you think about the new error handling? #3773 |
While experimenting with gatsby by making a simple portfolio site, I made a mistake of not supplying
component
property to the object passed tocreatePage
function 🙈This is what I made my code looked like:
At that time, I didn't realize the error and was struggling to understand what was going on. The error message I got during the build process looked like:
The above error message is useful but it does not clearly highlight what I was missing.
To maintainers:
What do you think about throwing an error message which reads along the lines of:
We could point the user to the line number of the
createPage
function invocation.Note: The above request is not a priority and an enhancement. I'll let you guys decide if it is worth working on it.
The text was updated successfully, but these errors were encountered: