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

Implement step one of refactoring how we handle internal errors #2951

Merged
merged 2 commits into from
Nov 17, 2017

Conversation

KyleAMathews
Copy link
Contributor

Borrowed a bunch of code from create-react-app.

Eventual goal is that we centrally manage all errors so we can print
them more tidily in the terminal but also send them to the browser +
other places in the future.

Borrowed a bunch of code from create-react-app.

Eventual goal is that we centrally manage all errors so we can print
them more tidily in the terminal but also send them to the browser +
other places in the future.
@KyleAMathews
Copy link
Contributor Author

screen shot 2017-11-17 at 11 34 12 am

@gatsbybot
Copy link
Collaborator

gatsbybot commented Nov 17, 2017

Deploy preview ready!

Built with commit 0818b9f

https://deploy-preview-2951--gatsbygram.netlify.com

@@ -70,8 +70,7 @@ async function parseToAst(filePath, fileStr) {
`There was a problem parsing "${filePath}"; any GraphQL ` +
`fragments or queries in this file were not processed. \n` +
`This may indicate a syntax error in the code, or it may be a file type ` +
`That Gatsby does not know how to parse.`,
error
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jquense this wasn't supposed to be there right? The stack trace was just a long bunch of babel parsing nonsense.

}/___graphql`,
],
},
// compilationSuccessInfo: {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We're handling this directly now

@gatsbybot
Copy link
Collaborator

gatsbybot commented Nov 17, 2017

Deploy preview ready!

Built with commit 0818b9f

https://deploy-preview-2951--using-drupal.netlify.com

// // Only keep the first error. Others are often indicative
// // of the same problem, but confuse the reader with noise.
// if (messages.errors.length > 1) {
// messages.errors.length = 1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we'll restore this replacing FriendlyErrorsWebpackPlugin once the remainder of the error/warning refactoring is done.

@@ -13,13 +15,15 @@ const handlerP = fn => (...args) => {
}

function buildLocalCommands(cli, isLocalSite) {
const defaultHost = `localhost`
const defaultHost = `0.0.0.0`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Turns out Windows doesn't need us to listen on localhost, just that I guess the browser can't use 0.0.0.0 or something like that.

@KyleAMathews
Copy link
Contributor Author

This also adds local network ip (common feature request (thanks CRA))

@KyleAMathews KyleAMathews merged commit 6ddcc6d into master Nov 17, 2017
@KyleAMathews KyleAMathews deleted the step-1-errors branch November 17, 2017 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants