An error message thrown to my Gatsby & Typescript app. 'gatsby develop' doesn't work due to this.
Here's my web-app dependancies, please help.!!
"dependencies": {
"@emotion/react": "^11.4.0",
"@emotion/styled": "^11.3.0",
"babel-eslint": "^10.1.0",
"gatsby": "^3.5.0",
"gatsby-cli": "^3.5.0",
"gatsby-plugin-emotion": "^6.5.0",
"gatsby-plugin-image": "^1.4.0",
"gatsby-plugin-offline": "^4.4.0",
"gatsby-plugin-react-helmet": "^4.4.0",
"gatsby-plugin-sharp": "^3.4.1",
"gatsby-plugin-typescript": "^3.5.0",
"gatsby-remark-images": "^5.2.0",
"gatsby-remark-prismjs": "^5.2.0",
"gatsby-source-filesystem": "^3.4.0",
"gatsby-transformer-remark": "^4.2.0",
"gatsby-transformer-sharp": "^3.4.0",
"graphql": "^0.12.3",
"graphql-tag": "^2.12.4",
"init": "^0.1.2",
"peer-graphql": "0.0.3",
"prismjs": "^1.23.0",
"prop-types": "^15.7.2",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-helmet": "^6.1.0",
"tsc": "^2.0.3",
"typescript": "^4.2.4"
}
I just ran into this same issue, and it ended up being a peer dependency issue—specifically for the graphql package. Installing version 15.x solved the issue for me.
npm install graphql@^15.0.0
It looks like you installed graphql explicitly, however, you installed a really old version of it. My guess is that a dependency of yours installs a different version of graphql and the build process is then resolving it to your outdated one, or there's a peer dependency that you're not fulfilling, which would come up as a warning from yarn or npm (depending on which one you're using) on a fresh install.
The easiest way to resolve this would be for you upgrade to a newer version of graphql as this will just resolve the incompatibility immediately.
However, it's likely worth checking where you went wrong. Check your package manager for peer dependency warnings, use Yarn or npm's list command to find out what duplicates (if any) of the GraphQL.js package you have, and go from there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With