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

[1.0] - gatsby-plugin-offline - Build throws unhandled rejection error #1064

Closed
scottyeck opened this issue May 30, 2017 · 8 comments
Closed

Comments

@scottyeck
Copy link
Contributor

Using latest canary for gatsby, gatsby-link and gatsby-plugin-offline at time of writing.

bin/gatsby: time since started: 0.067
bin/cli: time since started: 0.162
lib/bootstrap/index.js time since started: 0.926
open and validate gatsby-config.js: 4.516ms
initial loading: 872.710ms
copy gatsby files: 34.896ms
sourcing and parsing nodes: 1026.680ms
UNHANDLED REJECTION Error: Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "0" does not.
    at assertValidName (/Users/scottyeck/git/fabric/cashmere/node_modules/graphql/utilities/assertValidName.js:44:11)
    at /Users/scottyeck/git/fabric/cashmere/node_modules/graphql/type/definition.js:651:44
    at Array.forEach (native)
    at GraphQLInputObjectType._defineFieldMap (/Users/scottyeck/git/fabric/cashmere/node_modules/graphql/type/definition.js:650:16)
    at GraphQLInputObjectType.getFields (/Users/scottyeck/git/fabric/cashmere/node_modules/graphql/type/definition.js:639:49)
    at typeMapReducer (/Users/scottyeck/git/fabric/cashmere/node_modules/graphql/type/schema.js:221:26)
    at typeMapReducer (/Users/scottyeck/git/fabric/cashmere/node_modules/graphql/type/schema.js:187:12)
    at /Users/scottyeck/git/fabric/cashmere/node_modules/graphql/type/schema.js:224:20
    at Array.forEach (native)
    at typeMapReducer (/Users/scottyeck/git/fabric/cashmere/node_modules/graphql/type/schema.js:222:28)
    at /Users/scottyeck/git/fabric/cashmere/node_modules/graphql/type/schema.js:224:20
    at Array.forEach (native)
    at typeMapReducer (/Users/scottyeck/git/fabric/cashmere/node_modules/graphql/type/schema.js:222:28)
    at Array.reduce (native)
    at /Users/scottyeck/git/fabric/cashmere/node_modules/graphql/type/schema.js:214:36
    at Array.forEach (native)
UNHANDLED REJECTION Error: Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "0" does not.
    at assertValidName (/Users/scottyeck/git/fabric/cashmere/node_modules/graphql/utilities/assertValidName.js:44:11)
    at /Users/scottyeck/git/fabric/cashmere/node_modules/graphql/type/definition.js:651:44
    at Array.forEach (native)
    at GraphQLInputObjectType._defineFieldMap (/Users/scottyeck/git/fabric/cashmere/node_modules/graphql/type/definition.js:650:16)
    at GraphQLInputObjectType.getFields (/Users/scottyeck/git/fabric/cashmere/node_modules/graphql/type/definition.js:639:49)
    at typeMapReducer (/Users/scottyeck/git/fabric/cashmere/node_modules/graphql/type/schema.js:221:26)
    at typeMapReducer (/Users/scottyeck/git/fabric/cashmere/node_modules/graphql/type/schema.js:187:12)
    at /Users/scottyeck/git/fabric/cashmere/node_modules/graphql/type/schema.js:224:20
    at Array.forEach (native)
    at typeMapReducer (/Users/scottyeck/git/fabric/cashmere/node_modules/graphql/type/schema.js:222:28)
    at /Users/scottyeck/git/fabric/cashmere/node_modules/graphql/type/schema.js:224:20
    at Array.forEach (native)
    at typeMapReducer (/Users/scottyeck/git/fabric/cashmere/node_modules/graphql/type/schema.js:222:28)
    at Array.reduce (native)
    at /Users/scottyeck/git/fabric/cashmere/node_modules/graphql/type/schema.js:214:36
    at Array.forEach (native)
@KyleAMathews
Copy link
Contributor

Ugh, I don't know why people are running into this. I can't reproduce it. Weirdly if I tell people to use yarn for installing it instead of NPM it works https://github.com/gatsbyjs/gatsby-starter-blog/issues/30

My main guess is it's an old issue but keeps cropping up because Lerna doesn't name its canaries nicely lerna/lerna#277

Could you try actually installing with yarn? Delete node_modules and run things again?

@scottyeck
Copy link
Contributor Author

Yup will verify rn.

@scottyeck
Copy link
Contributor Author

Verified that it works as expected with yarn. Probably best to move this into a discussion that revolves solely around npm support.

@KyleAMathews
Copy link
Contributor

It's really lerna I'm guessing that's the problem — that combined with some difference in how npm & yarn resolve modules.

The problem will almost certainly go away once the pace of changes slows a bit and we can just rely on the next releases which are nicely ordered.

@scottyeck
Copy link
Contributor Author

Interesting. In that case, I'll take a stab at just installing alpha16 rather than the latest canary to see if that does anything. Will report back later.

@KyleAMathews
Copy link
Contributor

KyleAMathews commented May 30, 2017 via email

@levibuzolic
Copy link
Contributor

For anybody else that happens across this issue.

I was getting the same when using both yarn and npm.
Manually setting "gatsby": "v1.0.0-alpha16" in my package.json got things working again.

@scottyeck
Copy link
Contributor Author

@levibuzolic Thanks. Sounds like @KyleAMathews is spot on then - npm doesn't like lerna's naming conventions around the canaries. Closing.

TLDR: If you want to use a canary, use yarn. Boring.

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

3 participants