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

gatsby bulid errors #1138

Closed
rdela opened this issue Feb 25, 2018 · 2 comments
Closed

gatsby bulid errors #1138

rdela opened this issue Feb 25, 2018 · 2 comments

Comments

@rdela
Copy link

rdela commented Feb 25, 2018

On node 9.6.1, npm v5.6.0, and yarn 1.3.2, I just had to pin both

"gatsby": "1.9.212",
"gatsby-plugin-netlify-cms": "1.0.8",

…on an experiment based on the Gatsby + Netlify CMS Starter to get build working.

Various errors on local build and newer Gatsby:

error You used a reserved field name in the context object when creating a page:

  * "path"

{
    "path": "about",
    "component": "/Users/[…]/src/templates/about-page.js",
    "context": {
        "path": "about"
    }
}

Data in "context" is passed to GraphQL as potential arguments when running the
page query.

When arguments for GraphQL are constructed, the context object is combined with
the page object so both page object and context data are available as
arguments. If a context field duplicates a field already used by the page
object, this can break functionality within Gatsby so must be avoided.

Please choose another name for the conflicting fields.

The following fields are used by the page object and must be avoided.

  * "path"
  * "matchPath"
  * "component"
  * "componentChunkName"
  * "pluginCreator___NODE"
  * "pluginCreatorName"

…and remote bulid errors like:

12:16:18 PM: success Building CSS — 15.913 s
12:17:30 PM: error Generating JavaScript bundles failed
12:17:30 PM: 
12:17:30 PM:   Error: app-44c0ec4e989ce3631b16.js from UglifyJs
12:17:30 PM:   SyntaxError: Unexpected character '`' [./~/gatsby-plugin-netlify-cms/gatsby-br  owser.js:10,0]
12:17:30 PM: 
12:17:30 PM: npm
12:17:30 PM:  ERR! code ELIFECYCLE
12:17:30 PM: npm ERR! errno 1
12:17:30 PM: npm ERR! [email protected] build: `gatsby build`
12:17:30 PM: npm ERR! Exit status 1
12:17:30 PM: npm ERR!
12:17:30 PM: npm ERR! Failed at the [email protected] build script.

Maybe an underlying issue from #1097 persists? Cc @tech4him1 @erquhart

@rdela
Copy link
Author

rdela commented Feb 25, 2018

related gatsbyjs/gatsby#4233

@erquhart
Copy link
Contributor

This has been fixed in the starter, the context object just needs to be removed.

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

No branches or pull requests

2 participants