-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Tutorial Part Four - 'Multiple "root" queries found' #22795
Comments
Your repo works fine for me. For anonymous queries (i.e. ones that look like Since it's finding the exact same query in the exact same place, two times over, and the fact that it works fine for me, I think there might be an issue with your cached state. Can you try running |
Okay I ran the clean command and got the following output:
I ran
|
Interesting 🤔. Can you also post the output immediately following > npm run start
> gatsby-starter-hello-world@0.1.0 start D:\dev\source\gatsby\gatsby-four
> npm run develop
> gatsby-starter-hello-world@0.1.0 develop D:\dev\source\gatsby\gatsby-four
> gatsby develop Also, what shell/terminal are you using? CMD? Powershell? Or something like |
Can you also verify that the case of every segment in your current path matches the real case on the disk? For example, if |
When I run `> npm run develop
And I'm using |
I think VS Code has been started with the wrong path name. According to Gatsby, the path of your files is Do you also have output that looks like this? warn The plugin "dev-404-page" created a page with a component path that doesn't match the casing of the actual file. This may work locally, but will break on systems which
are case-sensitive, e.g. most CI/CD pipelines.
page.component: "D:/Dev/source/gatsby/gatsby-four/.cache/dev-404-page.js"
path in filesystem: "D:/dev/source/gatsby/gatsby-four/.cache/dev-404-page.js"
warn The plugin "gatsby-plugin-page-creator" created a page with a component path that doesn't match the casing of the actual file. This may work locally, but will break on
systems which are case-sensitive, e.g. most CI/CD pipelines.
page.component: "D:/Dev/source/gatsby/gatsby-four/src/pages/about.js"
path in filesystem: "D:/dev/source/gatsby/gatsby-four/src/pages/about.js"
warn The plugin "gatsby-plugin-page-creator" created a page with a component path that doesn't match the casing of the actual file. This may work locally, but will break on
systems which are case-sensitive, e.g. most CI/CD pipelines.
page.component: "D:/Dev/source/gatsby/gatsby-four/src/pages/index.js"
path in filesystem: "D:/dev/source/gatsby/gatsby-four/src/pages/index.js"
warn The plugin "gatsby-plugin-page-creator" created a page with a component path that doesn't match the casing of the actual file. This may work locally, but will break on
systems which are case-sensitive, e.g. most CI/CD pipelines.
page.component: "D:/Dev/source/gatsby/gatsby-four/src/pages/my-files.js"
path in filesystem: "D:/dev/source/gatsby/gatsby-four/src/pages/my-files.js" |
I renamed my Projects folder to be lowercase (projects) and it seems to be working now. I didn't take into account that case sensitivity would cause any issue. Thanks so much! |
You're welcome. Case sensitivity can definitely be an issue sometimes. I normally see it when somebody is moving from Windows to Linux, like when they deploy to something like Netlify (that's generally because something in their code has the wrong case, which is a bit harder to catch). I guess it's just one of the perils of working cross-platform 🙂 . I'll go ahead and close this as resolved. Feel free to comment again if you have more questions! |
The comments here helped me solve my problem, but it's a bit stranger with PowerShell: I did the following to get to
This meant the Current Directory shows in PowerShell as lower-case: I would say this is a problem with PowerShell. Although case-insensitive searching is great, when I move to that folder, it should display with the correct case of the folder. When I navigated correctly back to the folder with the right case gatsby worked for me |
Description
I was following along the fourth tutorial on the GatsbyJs site where I was querying data via GraphQL. My code was copied from the snippets provided in that section.
Steps to reproduce
Here's my repo: https://github.com/davidbowes818/gatsby-four
When I run

npm start
I get the following on my localhost:Expected result
The tutorial screenshots show the results from the GraphQL query being output to the page.
Actual result
There's a compiler error stating that multiple root queries are found.
I have a static query defined in my Layout component (layout.js) and a query in my About page (pages/about.js) that are both attempting to render the site metadata's title.
Environment
System:
OS: Windows 10 10.0.18362
CPU: (4) x64 Intel(R) Core(TM) i5-2500K CPU @ 3.30GHz
Binaries:
Node: 12.10.0 - C:\Program Files\nodejs\node.EXE
npm: 6.10.3 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: 44.18362.449.0
npmPackages:
gatsby: ^2.19.45 => 2.19.45
gatsby-plugin-emotion: ^4.2.1 => 4.2.1
gatsby-plugin-typography: ^2.4.1 => 2.4.1
gatsby-source-filesystem: ^2.2.2 => 2.2.2
The text was updated successfully, but these errors were encountered: