Gatsby: Gatsbyjs build fails with no error message.

Created on 14 Aug 2017  ·  6Comments  ·  Source: gatsbyjs/gatsby

I've tried looking at render-page.js:78868 which fortunately points to one of my components but I can't find any errors. I think there's supposed to be an error message but it just shows 'Error:' with nothing after it.

success Generating CSS — 9.491 s
success Compiling production bundle.js — 17.304 s
⠐ Generating static HTML for pages
error Generating static HTML for pages failed

See our docs page on debugging HTML builds for help https://goo.gl/yL9lND
  Error: 
    Error: 

    - render-page.js:78868   Index.render
      render-page.js:78868:35

    - render-page.js:15074   ReactCompositeComponentWrapper._renderValidatedComponen      0mtWithoutOwnerOrContext
      render-page.js:15074:31

    - render-page.js:15097   ReactCompositeComponentWrapper._renderValidatedComponen      0mt
      render-page.js:15097:33

    - render-page.js:14637   ReactCompositeComponentWrapper.performInitialMount
      render-page.js:14637:31

    - render-page.js:14533   ReactCompositeComponentWrapper.mountComponent
      render-page.js:14533:22

    - render-page.js:7445   [0mObject.mountComponent
      render-page.js:7445:36

    - render-page.js:13674   ReactDOMComponent.mountChildren
      render-page.js:13674:45

    - render-page.js:10684   ReactDOMComponent._createContentMarkup
      render-page.js:10684:33

    - render-page.js:10551   ReactDOMComponent.mountComponent
      render-page.js:10551:30

    - render-page.js:7445   [0mObject.mountComponent
      render-page.js:7445:36

All 6 comments

@whmountains – Can you open public/render-page.js (usually a gitignore'd file) and look at line 78868?

That might give you a better sense of the issue. It may be related to #1786.

Update, I was able to get the real error message by editing the createErrorFromString function in node_modules/gatsby/dist/reporter/errors.js:

TypeError: Cannot read property 'splashImg' of undefined
    at Index.render (render-page.js:78868:35)
    at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext (render-page.js:15074:31)
    at ReactCompositeComponentWrapper._renderValidatedComponent (render-page.js:15097:33)
    at ReactCompositeComponentWrapper.performInitialMount (render-page.js:14637:31)
    at ReactCompositeComponentWrapper.mountComponent (render-page.js:14533:22)
    at Object.mountComponent (render-page.js:7445:36)
    at ReactDOMComponent.mountChildren (render-page.js:13674:45)
    at ReactDOMComponent._createContentMarkup (render-page.js:10684:33)
    at ReactDOMComponent.mountComponent (render-page.js:10551:30)
    at Object.mountComponent (render-page.js:7445:36)

So it seems like Gatsby is not parsing the error string correctly.

@whmountains – Is slashImg supposed to come from props.data?

@danoc yes, splashImg comes from props.data. The relevant code is:

const { splashImg } = this.props.data

and the graphql query is:

query IndexQuery {
    splashImg: imageSharp(id: { regex: "/splash-full/" }) {
      ...imageInfo
    }
}

@danoc Thanks for pointing out the connection to #1786!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jimfilippou picture jimfilippou  ·  3Comments

ghost picture ghost  ·  3Comments

dustinhorton picture dustinhorton  ·  3Comments

signalwerk picture signalwerk  ·  3Comments

benstr picture benstr  ·  3Comments