Skip to content
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

Cannot use ESM together with CJS -> cannot use "import" with graphql-express #2740

Closed
schrotie opened this issue Aug 11, 2020 · 3 comments
Closed

Comments

@schrotie
Copy link

When mixing ECMA script modules (via import) and CommonJS modules in node.js (V14.5.0) then GraphQL complains that duplicate GraphQL modules cannot be used together.

One consequence of this is that it is to my knowledge impossible to use express-graphql together with import syntax. That is seemingly because "import" pulls other code than the "require" that express-graphql will use.

@isabelleingato
Copy link

Hello! New here and I'd like to look into this if that's okay. Do you happen to have a min repro example? I haven't seemed to run into this issue myself using express-graphql v0.12.0 with import syntax and requiring graphql v15.4.0 as cjs in the same project, so I want to make sure I'm understanding the question / set up.

I've seen similar errors before when mixing versions of graphql, unsure if related.

`Cannot use ${className} "${value}" from another module or realm.
, #491

thanks!

@schrotie
Copy link
Author

schrotie commented Jun 7, 2021

Sorry, I don't have a min-setup and I haven't worked with graphql for quite some time now.

@yaacovCR
Copy link
Contributor

We are tracking cjs/esm interaction in a new issue, #4062, closing this older one.

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

No branches or pull requests

3 participants