Open vemonet opened 2 years ago
It seems like this is quite a recurring issue in the JavaScript - GraphQL ecosystem! https://github.com/ardatan/graphql-tools/issues/2456
Most of those messages are 1 year old, and the issue is declared to be fixed since then by a lot of people. But we are still getting the error when installing the latest versions of the "patched" packages (which should not have any trace of compiler-sfc)
The problem seems to come from the mess of dependencies required to have GraphQL working.
Originally there was this dependency: graphql-tools
But according to this github issue https://github.com/ardatan/graphql-tools/issues/2456 we can't use graphql-tools
anymore, and we should use some other new packages. It is not clear which package we need, someone mentioned that create-react-app was installing this by default:
"@graphql-mesh/cli": "^0.16.0",
"@graphql-mesh/config": "^0.11.14",
"@graphql-mesh/graphql": "^0.13.1",
"@graphql-mesh/runtime": "^0.10.14",
Other are mentioning @graphql-tools/merge
and we can also see the use of import { makeExecutableSchema } from "@graphql-tools/schema";
If I am checking Apollo server docs, they tell me that I need the following dependencies: @apollo/client graphql
(2 completely different one!)
So I removed the graphql-tools
dependency that seems to be the problem, and that does not seems to be required for running GraphQL.
Indeed it is not required for GraphQL since my GraphQL endpoint and all pages related to GraphQL still works... Apart from SOFA API which gives this error:
./node_modules/apollo-server-core/dist/ApolloServer.js:28:0
Module not found: Can't resolve 'net'
null
So by removing this useless package I now miss dependencies to Apollo server only on the SOFA API page for some reason, even if my whole Apollo server is working fine everywhere else! What a ride!
@ardatan do you know exactly which library should we use to declare the GraphQL schema? This seems to be the problem here (but I could be wrong). What is the exact line to yarn add
? And what are the exact lines we need to import a Schema that will be supported by SOFA API?
Hi,
A few months ago we had an issue with SOFA trying to import Vue js dependencies that we never asked for, especially that we are using React: https://github.com/Urigo/SOFA/issues/797
According to the answer this is not a dependency anymore, but if I am trying to reinstall sofa-api in my NextJS project I am still getting the exact same error related to a vue dependency:
This is the output of
yarn add
when I add sofa-apiNote that the GitHub Releases versions are not matching the current versions: it installed 0.11.0, and according to npm it is 0.11.0: https://www.npmjs.com/package/sofa-api . But according to your GitHub releases the latest version is v0.10.2
I used the framework agnostic example, cf. the exact code here:
You can find all details of other dependencies used in the project in the
package.json
: https://github.com/bio2kg/bio2kg-registry/blob/main/website/package.jsonI use Ubuntu 20.04 with NodeJS v16.12.0 and yarn 1.22.17
Any idea where it could come from? @ardatan