graphql / graphql-http

Simple, pluggable, zero-dependency, GraphQL over HTTP spec compliant server, client and audit suite.

Home Page:https://graphql-http.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`graphql` seems to have an issue with vite-node

nopeless opened this issue · comments

I apologize if this bug is invalid. I tried searching the internet for similar issues but could not find one.

I believe this has something to do with how libraries are bundled in vite-node.

Here is a reproduction

https://stackblitz.com/edit/stackblitz-starters-se6shc

node src/server.js works but running yarn dev fails

If this is a vite-node or graphql issue, let me know.

Many things can be wrong or it all may just be an incompatibility issue. It would be nice if someone could explain what is going on and let others know the solution if they are encountering the same issue.

The error hints:

Ensure that there is only one instance of "graphql" in the node_modules
directory. If different versions of "graphql" are the dependencies of other
relied on modules, use "resolutions" to ensure only one version is installed.

Which is weird because you do only have one graphql module.

This issue is not caused by graphql-http though, it belongs more to yarn or vite-node.