Failed to compile: Multiple "root" queries found #29690
Labels
status: needs reproduction
This issue needs a simplified reproduction of the bug for further troubleshooting.
type: bug
An issue or pull request relating to a bug in Gatsby
Description
I followed the steps to develop gatsby using this template (Gatsby Starter Elemental). At first, everything works fine and I just have to make some changes to some files. But then after I tried to open the project again, this error occurred. I actually fixed this problem twice using this thread #24902 but for some reason, the problem kept coming back until the solution does not work again.
I found thread #22795 quite similar to my case, but the solution is just renaming the directory when developing the environment and I don't think I have the same problems as this thread.
Steps to reproduce
My GitHub project repo: https://github.com/jjoshkan/portfolio_el
I tried running the
gatsby develop
command into my Windows PowerShell and got this error messageExpected result
It should output the same as the above screenshot
Actual result
There should not be multiple root queries in either about.tsx and index.tsx (sometimes it's not just index.tsx, the error also tells me that multiple queries in about.tsx detected).
Environment
System:
OS: Windows 10 10.0.19042
CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
Binaries:
Node: 15.5.1 - C:\Program Files\nodejs\node.EXE
npm: 7.3.0 - C:\Program Files\nodejs\npm.CMD
Languages:
Python: 3.7.2
Browsers:
Chrome: 88.0.4324.182
Edge: Spartan (44.19041.423.0), Chromium (88.0.705.74)
npmPackages:
gatsby: 2.23.3 => 2.23.3
gatsby-image: ^2.3.1 => 2.9.0
gatsby-plugin-codegen: ^1.1.0 => 1.2.14
gatsby-plugin-disqus: ^1.1.4 => 1.2.2
gatsby-plugin-mdx: ^1.1.3 => 1.8.0
gatsby-plugin-postcss: ^2.2.1 => 2.3.13
gatsby-plugin-react-helmet: ^3.2.1 => 3.8.0
gatsby-plugin-sharp: ^2.5.3 => 2.12.0
gatsby-plugin-typescript: ^2.4.0 => 2.10.0
gatsby-remark-images: ^3.2.1 => 3.9.0
gatsby-source-filesystem: ^2.2.2 => 2.9.0
gatsby-transformer-sharp: ^2.4.3 => 2.10.0
npmGlobalPackages:
gatsby-cli: 2.19.1
The text was updated successfully, but these errors were encountered: