Skip to content
This repository was archived by the owner on Feb 11, 2021. It is now read-only.

Cannot use GraphQLDirective "@include" from another module or realm #176

Open
statebait opened this issue Apr 5, 2020 · 7 comments
Open

Comments

@statebait
Copy link

Facing this issue:

Screenshot 2020-04-05 at 11 16 44 PM

Using version 3.5.0

@jorytindall
Copy link

I'm also experiencing this issue. It seems like it's a dependency issue with gatsby-source-graphql-universal, another issue here.

@laradevitt
Copy link

Me, too. I just posted an issue:

birkir/gatsby-source-graphql-universal#14

A workaround is to add a resolution to your package.json.

@statebait
Copy link
Author

statebait commented Apr 6, 2020

Adding a resolution to package.json worked!

Like this:

"resolutions": {
   "graphql": "14.6.0"
}

@JeffWeim
Copy link

JeffWeim commented Apr 6, 2020

Adding a resolution to package.json worked!

Like this:

"resolutions": {
   "graphql": "14.6.0"
}

I can also confirm this solution works

@codingwithchris
Copy link

codingwithchris commented Apr 7, 2020

Same error here. Unfortunately the proposed solution of:

"resolutions": {
   "graphql": "14.6.0"
}

Did not work for me :/
Putting the resolution in place resulted in the following error:

Error in "/src/projects/nerve/nervetheatre.org/node_modules/gatsby-source-prismic-graphql/gatsby-node.js": Cannot find module 'apollo-link-http'
Require stack:
- /src/projects/nerve/nervetheatre.org/node_modules/gatsby-source-prismic-graphql/utils/index.js
- /src/projects/nerve/nervetheatre.org/node_modules/gatsby-source-prismic-graphql/gatsby-node.js
- /src/projects/nerve/nervetheatre.org/node_modules/gatsby/dist/bootstrap/resolve-module-exports.js
- /src/projects/nerve/nervetheatre.org/node_modules/gatsby/dist/bootstrap/load-plugins/validate.js
- /src/projects/nerve/nervetheatre.org/node_modules/gatsby/dist/bootstrap/load-plugins/load.js
- /src/projects/nerve/nervetheatre.org/node_modules/gatsby/dist/bootstrap/load-plugins/index.js
- /src/projects/nerve/nervetheatre.org/node_modules/gatsby/dist/bootstrap/index.js
- /src/projects/nerve/nervetheatre.org/node_modules/gatsby/dist/commands/develop.js
- /src/projects/nerve/nervetheatre.org/node_modules/gatsby-cli/lib/create-cli.js
- /src/projects/nerve/nervetheatre.org/node_modules/gatsby-cli/lib/index.js

I tried removing node modules + cache and installing from scratch and had the same result. My full runtime package list is as follows:

	"dependencies": {
		"date-fns": "^2.11.1",
		"dotenv": "^8.2.0",
		"gatsby": "^2.20.12",
		"gatsby-background-image": "^1.0.1",
		"gatsby-cli": "^2.11.5",
		"gatsby-image": "^2.3.1",
		"gatsby-plugin-manifest": "^2.3.3",
		"gatsby-plugin-offline": "^3.1.2",
		"gatsby-plugin-react-helmet": "^3.2.1",
		"gatsby-plugin-robots-txt": "^1.5.0",
		"gatsby-plugin-sharp": "^2.5.4",
		"gatsby-plugin-sitemap": "^2.3.1",
		"gatsby-plugin-styled-components": "^3.2.1",
		"gatsby-plugin-typescript": "^2.3.1",
		"gatsby-source-filesystem": "^2.2.2",
		"gatsby-source-prismic-graphql": "^3.5.0",
		"gatsby-transformer-sharp": "^2.4.4",
		"graphql": "^15.0.0",
		"intersection-observer": "^0.7.0",
		"prop-types": "^15.7.2",
		"react": "^16.13.1",
		"react-dom": "^16.13.1",
		"react-helmet": "^5.2.1",
		"react-youtube": "^7.11.1",
		"styled-components": "^5.0.1"
	}

@laradevitt
Copy link

I have opened an issue in gatsby-source-graphql-universal. The problem is not with this project. It might be more helpful to the maintainer if we post our reports over there.

Not a huge deal, but for those adding the resolution, to remain in sync with Gatsby I'd recommend including the carat as described in the other issue:

  "resolutions": {
    "graphql": "^14.6.0"
  }

@MarcMcIntosh
Copy link

try npm dedupe

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants