Gatsbygram is erroring out in the CI and not exiting. The full log is here: https://ci.appveyor.com/project/KyleAMathews/gatsby/build/1.0.370/job/40qel5sx059fbmyi
npm run build
> [email protected] build C:\projects\gatsby\examples\gatsbygram
> gatsby build
bin/gatsby: time since started: 0.097
bin/cli: time since started: 0.189
lib/bootstrap/index.js time since started: 1.203 sec
open and validate gatsby-config.js: 6.453ms
initial loading: 1590.370ms
copy gatsby files: 29.342ms
initial sourcing and transforming nodes: 534.850ms
(node:2552) Warning: No such label 'building schema' for console.timeEnd()
createPages: 149.637ms
createPagesStatefully: 14.281ms
UNHANDLED REJECTION Invariant Violation: RelayCompilerContext: Duplicate document named `allImages`. GraphQL fragments and roots must have unique names.
at invariant (C:\projects\gatsby\examples\gatsbygram\node_modules\fbjs\lib\invariant.js:44:15)
at RelayCompilerContext.add (C:\projects\gatsby\examples\gatsbygram\node_modules\relay-compiler\lib\RelayCompilerContext.js:61:34)
at C:\projects\gatsby\examples\gatsbygram\node_modules\relay-compiler\lib\RelayCompilerContext.js:70:18
at Array.reduce (native)
at RelayCompilerContext.addAll (C:\projects\gatsby\examples\gatsbygram\node_modules\relay-compiler\lib\RelayCompilerContext.js:69:18)
at Runner._callee3$ (C:\projects\gatsby\examples\gatsbygram\node_modules\gatsby\dist\internal-plugins\query-runner\query-compiler.js:198:51)
at tryCatch (C:\projects\gatsby\examples\gatsbygram\node_modules\regenerator-runtime\runtime.js:65:40)
at Generator.invoke [as _invoke] (C:\projects\gatsby\examples\gatsbygram\node_modules\regenerator-runtime\runtime.js:303:22)
at Generator.prototype.(anonymous function) [as next] (C:\projects\gatsby\examples\gatsbygram\node_modules\regenerator-runtime\runtime.js:117:21)
at step (C:\projects\gatsby\examples\gatsbygram\node_modules\babel-runtime\helpers\asyncToGenerator.js:17:30)
at C:\projects\gatsby\examples\gatsbygram\node_modules\babel-runtime\helpers\asyncToGenerator.js:35:14
at new Promise (C:\projects\gatsby\examples\gatsbygram\node_modules\core-js\library\modules\es6.promise.js:191:7)
at Runner.<anonymous> (C:\projects\gatsby\examples\gatsbygram\node_modules\babel-runtime\helpers\asyncToGenerator.js:14:12)
at Runner.write (C:\projects\gatsby\examples\gatsbygram\node_modules\gatsby\dist\internal-plugins\query-runner\query-compiler.js:235:22)
at Runner._callee$ (C:\projects\gatsby\examples\gatsbygram\node_modules\gatsby\dist\internal-plugins\query-runner\query-compiler.js:110:55)
at tryCatch (C:\projects\gatsby\examples\gatsbygram\node_modules\regenerator-runtime\runtime.js:65:40)
UNHANDLED REJECTION Invariant Violation: RelayCompilerContext: Duplicate document named `allImages`. GraphQL fragments and roots must have unique names.
at invariant (C:\projects\gatsby\examples\gatsbygram\node_modules\fbjs\lib\invariant.js:44:15)
at RelayCompilerContext.add (C:\projects\gatsby\examples\gatsbygram\node_modules\relay-compiler\lib\RelayCompilerContext.js:61:34)
at C:\projects\gatsby\examples\gatsbygram\node_modules\relay-compiler\lib\RelayCompilerContext.js:70:18
at Array.reduce (native)
at RelayCompilerContext.addAll (C:\projects\gatsby\examples\gatsbygram\node_modules\relay-compiler\lib\RelayCompilerContext.js:69:18)
at Runner._callee3$ (C:\projects\gatsby\examples\gatsbygram\node_modules\gatsby\dist\internal-plugins\query-runner\query-compiler.js:198:51)
at tryCatch (C:\projects\gatsby\examples\gatsbygram\node_modules\regenerator-runtime\runtime.js:65:40)
at Generator.invoke [as _invoke] (C:\projects\gatsby\examples\gatsbygram\node_modules\regenerator-runtime\runtime.js:303:22)
at Generator.prototype.(anonymous function) [as next] (C:\projects\gatsby\examples\gatsbygram\node_modules\regenerator-runtime\runtime.js:117:21)
at step (C:\projects\gatsby\examples\gatsbygram\node_modules\babel-runtime\helpers\asyncToGenerator.js:17:30)
at C:\projects\gatsby\examples\gatsbygram\node_modules\babel-runtime\helpers\asyncToGenerator.js:35:14
at new Promise (C:\projects\gatsby\examples\gatsbygram\node_modules\core-js\library\modules\es6.promise.js:191:7)
at Runner.<anonymous> (C:\projects\gatsby\examples\gatsbygram\node_modules\babel-runtime\helpers\asyncToGenerator.js:14:12)
at Runner.write (C:\projects\gatsby\examples\gatsbygram\node_modules\gatsby\dist\internal-plugins\query-runner\query-compiler.js:235:22)
at Runner._callee$ (C:\projects\gatsby\examples\gatsbygram\node_modules\gatsby\dist\internal-plugins\query-runner\query-compiler.js:110:55)
at tryCatch (C:\projects\gatsby\examples\gatsbygram\node_modules\regenerator-runtime\runtime.js:65:40)
@jquense any guess why this is happening?
Only thing I can thing of is somehow files are getting duplicated/read twice? Maybe a Windows issue tho... I can try on my surface
copy gatsby files: 50.423ms
initial sourcing and transforming nodes: 100.678ms
(node:9820) Warning: No such label 'building schema' for console.timeEnd()
createPages: 37.718ms
createPagesStatefully: 31.893ms
UNHANDLED REJECTION Invariant Violation: RelayCompilerContext: Duplicate document named `IndexQuery`. GraphQL fragments and roots must have unique names.
at invariant (C:\Users\akaga\Documents\Github\linkMarketing\node_modules\fbjs\lib\invariant.js:44:15)
at RelayCompilerContext.add (C:\Users\akaga\Documents\Github\linkMarketing\node_modules\relay-compiler\lib\RelayCompilerContext.js:61:34)
at C:\Users\akaga\Documents\Github\linkMarketing\node_modules\relay-compiler\lib\RelayCompilerContext.js:70:18
at Array.reduce (native)
at RelayCompilerContext.addAll (C:\Users\akaga\Documents\Github\linkMarketing\node_modules\relay-compiler\lib\RelayCompilerContext.js:69:18)
at Runner._callee3$ (C:\Users\akaga\Documents\Github\linkMarketing\node_modules\gatsby\dist\internal-plugins\query-runner\query-compiler.js:198:51)
at tryCatch (C:\Users\akaga\Documents\Github\linkMarketing\node_modules\regenerator-runtime\runtime.js:65:40)
at Generator.invoke [as _invoke] (C:\Users\akaga\Documents\Github\linkMarketing\node_modules\regenerator-runtime\runtime.js:303:22)
at Generator.prototype.(anonymous function) [as next] (C:\Users\akaga\Documents\Github\linkMarketing\node_modules\regenerator-runtime\runtime.js:117:21)
at step (C:\Users\akaga\Documents\Github\linkMarketing\node_modules\babel-runtime\helpers\asyncToGenerator.js:17:30)
at C:\Users\akaga\Documents\Github\linkMarketing\node_modules\babel-runtime\helpers\asyncToGenerator.js:35:14
at new Promise (C:\Users\akaga\Documents\Github\linkMarketing\node_modules\core-js\library\modules\es6.promise.js:191:7)
at Runner.<anonymous> (C:\Users\akaga\Documents\Github\linkMarketing\node_modules\babel-runtime\helpers\asyncToGenerator.js:14:12)
at Runner.write (C:\Users\akaga\Documents\Github\linkMarketing\node_modules\gatsby\dist\internal-plugins\query-runner\query-compiler.js:235:22)
at Runner._callee$ (C:\Users\akaga\Documents\Github\linkMarketing\node_modules\gatsby\dist\internal-plugins\query-runner\query-compiler.js:110:55)
at tryCatch (C:\Users\akaga\Documents\Github\linkMarketing\node_modules\regenerator-runtime\runtime.js:65:40)
getting the same error but with IndexQuery. Changed the name to something completely random and it said that was duplicated as well.
@akadop are you on Windows?
I was on a Windows machine as of when I posted it, giving it a try on my mac now.
Edit:
Can confirm this is a windows problem. Ran the same code through the mac and it's working
I also have this problem on windows, or something that looks much like it on the 1.0 branch:
UNHANDLED REJECTION Invariant Violation: RelayCompilerContext: Duplicate document named `BlogPostByPath`. GraphQL fragments and roots must have unique names.
at invariant (C:\Users\Allan\Desktop\gatsby-test\node_modules\fbjs\lib\invariant.js:44:15)
at RelayCompilerContext.add (C:\Users\Allan\Desktop\gatsby-test\node_modules\relay-compiler\lib\RelayCompilerContext.js:61:34)
at C:\Users\Allan\Desktop\gatsby-test\node_modules\relay-compiler\lib\RelayCompilerContext.js:70:18
at Array.reduce (native)
at RelayCompilerContext.addAll (C:\Users\Allan\Desktop\gatsby-test\node_modules\relay-compiler\lib\RelayCompilerContext.js:69:18)
at Runner._callee3$ (C:\Users\Allan\Desktop\gatsby-test\node_modules\gatsby\dist\internal-plugins\query-runner\query-compiler.js:198:51)
at tryCatch (C:\Users\Allan\Desktop\gatsby-test\node_modules\regenerator-runtime\runtime.js:65:40)
at Generator.invoke [as _invoke] (C:\Users\Allan\Desktop\gatsby-test\node_modules\regenerator-runtime\runtime.js:303:22)
at Generator.prototype.(anonymous function) [as next] (C:\Users\Allan\Desktop\gatsby-test\node_modules\regenerator-runtime\runtime.js:117:21)
at step (C:\Users\Allan\Desktop\gatsby-test\node_modules\babel-runtime\helpers\asyncToGenerator.js:17:30)
at C:\Users\Allan\Desktop\gatsby-test\node_modules\babel-runtime\helpers\asyncToGenerator.js:35:14
at new Promise (C:\Users\Allan\Desk
Someone want to take a crack at debugging this and figuring out how the
compiler is (apparently) either parsing the same files twice or somehow
duplicating how it stores things.
The latter might be it given its a windows only issue. Perhaps the paths
it'sโ using to store things aren't consistent.
On Sun, Jun 4, 2017, 4:54 AM Allan Kimmer Jensen notifications@github.com
wrote:
I also have this problem on windows, or something that looks much like it
on the 1.0 branch:UNHANDLED REJECTION Invariant Violation: RelayCompilerContext: Duplicate document named
BlogPostByPath. GraphQL fragments and roots must have unique names.
at invariant (C:\Users\Allan\Desktop\gatsby-test\node_modules\fbjs\libinvariant.js:44:15)
at RelayCompilerContext.add (C:\Users\Allan\Desktop\gatsby-test\node_modules\relay-compiler\lib\RelayCompilerContext.js:61:34)
at C:\Users\Allan\Desktop\gatsby-test\node_modules\relay-compiler\lib\RelayCompilerContext.js:70:18
at Array.reduce (native)
at RelayCompilerContext.addAll (C:\Users\Allan\Desktop\gatsby-test\node_modules\relay-compiler\lib\RelayCompilerContext.js:69:18)
at Runner._callee3$ (C:\Users\Allan\Desktop\gatsby-test\node_modules\gatsby\distinternal-plugins\query-runner\query-compiler.js:198:51)
at tryCatch (C:\Users\Allan\Desktop\gatsby-test\node_modules\regenerator-runtime\runtime.js:65:40)
at Generator.invoke [as _invoke] (C:\Users\Allan\Desktop\gatsby-test\node_modules\regenerator-runtime\runtime.js:303:22)
at Generator.prototype.(anonymous function) [as next] (C:\Users\Allan\Desktop\gatsby-test\node_modules\regenerator-runtime\runtime.js:117:21)
at step (C:\Users\Allan\Desktop\gatsby-test\node_modules\babel-runtime\helpers\asyncToGenerator.js:17:30)
at C:\Users\Allan\Desktop\gatsby-test\node_modules\babel-runtime\helpers\asyncToGenerator.js:35:14
at new Promise (C:\Users\Allan\Deskโ
You are receiving this because you commented.Reply to this email directly, view it on GitHub
https://github.com/gatsbyjs/gatsby/issues/1093#issuecomment-306035526,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEVhyOFmSM5A5nC4Acim-KVVLPDLmQ2ks5sApregaJpZM4Nu8gc
.
i wonder if its path issue, the paths are used as a cache key, perhaps somewhere the path is getting normalized and inserted twice
Yeah inconsistent normalization
On Tue, Jun 6, 2017, 12:12 PM Jason Quense notifications@github.com wrote:
i wonder if its path issue, the paths are used as a cache key, perhaps
somewhere the path is getting normalized and inserted twiceโ
You are receiving this because you commented.Reply to this email directly, view it on GitHub
https://github.com/gatsbyjs/gatsby/issues/1093#issuecomment-306587842,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEVh7y8hooXRZ3O53YuxQofwYaoArMzks5sBaSEgaJpZM4Nu8gc
.
path.normalize should handle these, we should probably make more judicious use of it...and prefer path.join/resolve over string concatenation
I don't have a windows machine to test on but I'll do a quick run through code to see if I can turn up areas where this is a problem. Appveyor does do a build of Gatsbygram on PRs so I'll see if I can get it passing there.
Pretty sure I found the bug. I recently added some code which added all component files to the list of files to parse (previously it was just adding files in src/). I think that's where the duplicates started coming from. I did run the combined list of files through _.uniq but if the file paths weren't normalized that wouldn't fix things. My fix is to just run all the paths from both globbing and adding component paths through path.normalize. We'll see if that does the trick. https://github.com/gatsbyjs/gatsby/pull/1113/files
I'm pretty sure that's the only place we compile so that should hopefully solve things.
I'll try to build with that pull request :-)
But maybe first tomorrow.
@Saturate thanks!
@KyleAMathews how would i do this the best way? Just clone it and do a npm link?
@Saturate with gatsby-dev-cli https://www.gatsbyjs.org/docs/how-to-contribute/
Great, I'll test it out!
I'm having an issue with the gatsby-dev tool, it halt and nothing happens. It prints out:
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby\.npmignore to node_modules\gatsby\.npmignore
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby\package.json to node_modules\gatsby\package.json
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-plugin-google-analytics\.babelrc to node_modules\gatsby-plugin-google-analytics\.babelrc
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-plugin-google-analytics\.npmignore to node_modules\gatsby-plugin-google-analytics\.npmignore
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-plugin-google-analytics\package.json to node_modules\gatsby-plugin-google-analytics\package.json
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-plugin-google-analytics\README.md to node_modules\gatsby-plugin-google-analytics\README.md
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-plugin-google-analytics\index.js to node_modules\gatsby-plugin-google-analytics\index.js
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-link\README.md to node_modules\gatsby-link\README.md
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-transformer-sharp\package.json to node_modules\gatsby-transformer-sharp\package.json
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-link\index.d.ts to node_modules\gatsby-link\index.d.ts
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-link\.npmignore to node_modules\gatsby-link\.npmignore
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-link\.babelrc to node_modules\gatsby-link\.babelrc
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-transformer-sharp\.npmignore to node_modules\gatsby-transformer-sharp\.npmignore
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-link\package.json to node_modules\gatsby-link\package.json
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-transformer-sharp\README.md to node_modules\gatsby-transformer-sharp\README.md
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-link\yarn.lock to node_modules\gatsby-link\yarn.lock
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-plugin-offline\.npmignore to node_modules\gatsby-plugin-offline\.npmignore
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-plugin-offline\index.js to node_modules\gatsby-plugin-offline\index.js
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-transformer-sharp\index.js to node_modules\gatsby-transformer-sharp\index.js
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-plugin-offline\README.md to node_modules\gatsby-plugin-offline\README.md
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-transformer-remark\README.md to node_modules\gatsby-transformer-remark\README.md
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-transformer-remark\.npmignore to node_modules\gatsby-transformer-remark\.npmignore
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-plugin-offline\package.json to node_modules\gatsby-plugin-offline\package.json
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-plugin-preact\.npmignore to node_modules\gatsby-plugin-preact\.npmignore
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-transformer-remark\index.js to node_modules\gatsby-transformer-remark\index.js
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-plugin-preact\README.md to node_modules\gatsby-plugin-preact\README.md
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-transformer-remark\package.json to node_modules\gatsby-transformer-remark\package.json
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-plugin-preact\index.js to node_modules\gatsby-plugin-preact\index.js
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-plugin-manifest\.npmignore to node_modules\gatsby-plugin-manifest\.npmignore
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-plugin-manifest\README.md to node_modules\gatsby-plugin-manifest\README.md
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-plugin-sharp\README.md to node_modules\gatsby-plugin-sharp\README.md
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-plugin-preact\package.json to node_modules\gatsby-plugin-preact\package.json
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-plugin-sharp\.npmignore to node_modules\gatsby-plugin-sharp\.npmignore
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-plugin-manifest\index.js to node_modules\gatsby-plugin-manifest\index.js
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-plugin-manifest\package.json to node_modules\gatsby-plugin-manifest\package.json
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-remark-responsive-iframe\README.md to node_modules\gatsby-remark-responsive-iframe\README.md
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-plugin-sharp\package.json to node_modules\gatsby-plugin-sharp\package.json
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-remark-responsive-iframe\.npmignore to node_modules\gatsby-remark-responsive-iframe\.npmignore
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-remark-responsive-iframe\package.json to node_modules\gatsby-remark-responsive-iframe\package.json
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-source-filesystem\.npmignore to node_modules\gatsby-source-filesystem\.npmignore
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-source-filesystem\README.md to node_modules\gatsby-source-filesystem\README.md
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-remark-prismjs\.npmignore to node_modules\gatsby-remark-prismjs\.npmignore
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-source-filesystem\package.json to node_modules\gatsby-source-filesystem\package.json
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-remark-prismjs\package.json to node_modules\gatsby-remark-prismjs\package.json
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-remark-prismjs\README.md to node_modules\gatsby-remark-prismjs\README.md
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-remark-smartypants\.npmignore to node_modules\gatsby-remark-smartypants\.npmignore
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-remark-smartypants\README.md to node_modules\gatsby-remark-smartypants\README.md
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-remark-smartypants\package.json to node_modules\gatsby-remark-smartypants\package.json
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-remark-responsive-image\.npmignore to node_modules\gatsby-remark-responsive-image\.npmignore
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-remark-responsive-image\package.json to node_modules\gatsby-remark-responsive-image\package.json
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-remark-copy-linked-files\.npmignore to node_modules\gatsby-remark-copy-linked-files\.npmignore
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-remark-responsive-image\README.md to node_modules\gatsby-remark-responsive-image\README.md
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-remark-copy-linked-files\README.md to node_modules\gatsby-remark-copy-linked-files\README.md
Copied C:\Users\Allan\Desktop\gatsby\packages\gatsby-remark-copy-linked-files\package.json to node_modules\gatsby-remark-copy-linked-files\package.json
that's deliberate โ by default it's meant as a watching tool where you keep it running while making changes to core so that your test site is always up-to-date. You can run it with --scan-once to have it quit once done.
Ah, sorry for my tons of questions...
I did run it, and then I ran yarn build but I still get the error. Am i missing something? I read the docs about contributing, and it seems like it should work.
@Saturate congrats, you've validated that my fix didn't work haha :-)
Now that you've got a dev environment setup, it'd probably be pretty easy to figure out where the duplicates are coming from now... ๐ค ๐
btw, are my console.log's outputting anything for you? They're not on appveyor for whatever reason... https://ci.appveyor.com/project/KyleAMathews/gatsby/build/job/5psvlqb7rchtard1
Haha @KyleAMathews I were about to build something like gatsby myself, but found you first. So I have no knowledge about the code, but well... I'll give it a go, I might be able to fix something.
I'll take a look in a second.
haha, glad we caught you first ๐ฃ
pull the latest version of my code as I fixed a typo https://github.com/gatsbyjs/gatsby/pull/1113
After a pull and a sync this is all I get:
yarn build v0.23.3
$ gatsby build
bin/gatsby: time since started: 0.102
bin/cli: time since started: 0.202
lib/bootstrap/index.js time since started: 1.287 sec
open and validate gatsby-config.js: 4.674ms
initial loading: 1577.698ms
copy gatsby files: 33.786ms
initial sourcing and transforming nodes: 49.827ms
(node:14808) Warning: No such label 'building schema' for console.timeEnd()
createPages: 29.719ms
createPagesStatefully: 10.993ms
UNHANDLED REJECTION Invariant Violation: RelayCompilerContext: Duplicate document named `BlogPostByPath`. GraphQL fragments and roots must have unique names.
at invariant (C:\Users\Allan\Desktop\gatsby-test\node_modules\fbjs\lib\invariant.js:44:15)
at RelayCompilerContext.add (C:\Users\Allan\Desktop\gatsby-test\node_modules\relay-compiler\lib\RelayCompilerContext.js:61:34)
at C:\Users\Allan\Desktop\gatsby-test\node_modules\relay-compiler\lib\RelayCompilerContext.js:70:18
at Array.reduce (native)
at RelayCompilerContext.addAll (C:\Users\Allan\Desktop\gatsby-test\node_modules\relay-compiler\lib\RelayCompilerContext.js:69:18)
at Runner._callee3$ (C:\Users\Allan\Desktop\gatsby-test\node_modules\gatsby\dist\internal-plugins\query-runner\query-compiler.js:198:51)
at tryCatch (C:\Users\Allan\Desktop\gatsby-test\node_modules\regenerator-runtime\runtime.js:65:40)
at Generator.invoke [as _invoke] (C:\Users\Allan\Desktop\gatsby-test\node_modules\regenerator-runtime\runtime.js:303:22)
at Generator.prototype.(anonymous function) [as next] (C:\Users\Allan\Desktop\gatsby-test\node_modules\regenerator-runtime\runtime.js:117:21)
at step (C:\Users\Allan\Desktop\gatsby-test\node_modules\babel-runtime\helpers\asyncToGenerator.js:17:30)
at C:\Users\Allan\Desktop\gatsby-test\node_modules\babel-runtime\helpers\asyncToGenerator.js:35:14
at new Promise (C:\Users\Allan\Desktop\gatsby-test\node_modules\core-js\library\modules\es6.promise.js:191:7)
at Runner.<anonymous> (C:\Users\Allan\Desktop\gatsby-test\node_modules\babel-runtime\helpers\asyncToGenerator.js:14:12)
at Runner.write (C:\Users\Allan\Desktop\gatsby-test\node_modules\gatsby\dist\internal-plugins\query-runner\query-compiler.js:235:22)
at Runner._callee$ (C:\Users\Allan\Desktop\gatsby-test\node_modules\gatsby\dist\internal-plugins\query-runner\query-compiler.js:110:55)
at tryCatch (C:\Users\Allan\Desktop\gatsby-test\node_modules\regenerator-runtime\runtime.js:65:40)
UNHANDLED REJECTION Invariant Violation: RelayCompilerContext: Duplicate document named `BlogPostByPath`. GraphQL fragments and roots must have unique names.
at invariant (C:\Users\Allan\Desktop\gatsby-test\node_modules\fbjs\lib\invariant.js:44:15)
at RelayCompilerContext.add (C:\Users\Allan\Desktop\gatsby-test\node_modules\relay-compiler\lib\RelayCompilerContext.js:61:34)
at C:\Users\Allan\Desktop\gatsby-test\node_modules\relay-compiler\lib\RelayCompilerContext.js:70:18
at Array.reduce (native)
at RelayCompilerContext.addAll (C:\Users\Allan\Desktop\gatsby-test\node_modules\relay-compiler\lib\RelayCompilerContext.js:69:18)
at Runner._callee3$ (C:\Users\Allan\Desktop\gatsby-test\node_modules\gatsby\dist\internal-plugins\query-runner\query-compiler.js:198:51)
at tryCatch (C:\Users\Allan\Desktop\gatsby-test\node_modules\regenerator-runtime\runtime.js:65:40)
at Generator.invoke [as _invoke] (C:\Users\Allan\Desktop\gatsby-test\node_modules\regenerator-runtime\runtime.js:303:22)
at Generator.prototype.(anonymous function) [as next] (C:\Users\Allan\Desktop\gatsby-test\node_modules\regenerator-runtime\runtime.js:117:21)
at step (C:\Users\Allan\Desktop\gatsby-test\node_modules\babel-runtime\helpers\asyncToGenerator.js:17:30)
at C:\Users\Allan\Desktop\gatsby-test\node_modules\babel-runtime\helpers\asyncToGenerator.js:35:14
at new Promise (C:\Users\Allan\Desktop\gatsby-test\node_modules\core-js\library\modules\es6.promise.js:191:7)
at Runner.<anonymous> (C:\Users\Allan\Desktop\gatsby-test\node_modules\babel-runtime\helpers\asyncToGenerator.js:14:12)
at Runner.write (C:\Users\Allan\Desktop\gatsby-test\node_modules\gatsby\dist\internal-plugins\query-runner\query-compiler.js:235:22)
at Runner._callee$ (C:\Users\Allan\Desktop\gatsby-test\node_modules\gatsby\dist\internal-plugins\query-runner\query-compiler.js:110:55)
at tryCatch (C:\Users\Allan\Desktop\gatsby-test\node_modules\regenerator-runtime\runtime.js:65:40)
Grr so weird. Could you open C:\Users\Allan\Desktop\gatsby-test\node_modules\gatsby\dist\internal-plugins\query-runner\query-compiler.js and verify that the console.logs are there?
Now i'm having node-gyp issues, and it's late here. I'll check it out tomorrow, I need to sleep :-)
So everything seems better now, however it halt at `Generating static HTML for pages``and then nothing happens.
If i run yarn run develop it works fine, but I do get a warning:
Warning: Each child in an array or iterator should have a unique "key" prop. Check the top-level render call using <body>. See https://fb.me/react-warning-keys for more information.
Ugh... that's the same error we're seeing on Appveyor โ where it stalls on generating static html.
Could you or someone else take a crack at debugging this? I don't have a windows dev box and pushing changes to appveyor and waiting 12 minutes for a response is pretty slow...
The meat of building HTML happens in https://github.com/gatsbyjs/gatsby/blob/1.0/packages/gatsby/src/cache-dir/static-entry.js
If you wanted to add some console.logs there and try building and see what happens that'd great.
I'll take a swing at it, thanks for the pointer.
Ever tought abort using debug (https://www.npmjs.com/package/debug) for keeping logs in the code? Basically it enables you to toggle logging for modules on a need to debug basis.
thanks ๐
We've used it at times but never systematically.
Looked a bit at it, and it seems like it's not in that file. It's not the simplest thing in the world to debug it would seem.
Might take another stab at it later, but I think i need to understand the flow of the code a bit better.
I faced a similar problem, and it turned out that I had two graphql query with the same name exported. So I changed one of the files and solved it. Hope it can help you.
It seems like this has resolved itself in favor of #1146. Is anyone still getting this error?
Doesn't seem like it, closing.
I'm still getting this issue on windows. What was the solution for this?
Any solutions yet? :(