I got: Cannot use GraphQLScalarType “String” from another module or realm.
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.
Duplicate “graphql” modules cannot be used at the same time since different
versions may have different capabilities and behavior. The data from one
version used in the function from another could produce confusing and
spurious results.
I’ve just joined the forum to report the same error. The way I came across this issue is by interacting with GraphiQL using the API whereas the issue raised by IvanH was triggered with the CLI approach.
I came across the error following the ‘Your first composite’ instructions here: Your first composite | ComposeDB on Ceramic
I’m at the ‘Interacting using GraphiQL’ stage and trying to run the script from the ‘Using the API’ tab:
import { serveEncodedDefinition } from '@composedb/devtools-node'
const server = await serveEncodedDefinition({
ceramicURL: 'http://localhost:7007',
graphiql: true,
path: new URL('my-first-composite.json', import.meta.url),
port: 5001,
})
console.log(`Server started on ${server.url}`)
process.on('SIGTERM', () => {
server.close(() => {
console.log('Server stopped')
})
})
I’m using Node v16.14.0 and @composedb/cli v0.3.0-rc.1.
Any help resolving this would be much appreciated!
The issue with the GraphQL dependencies is still mentioned by pnpm however when running the script the GraphQL server starts without issue. The working package.json looks like this:
I faced same issue and it is true that works with pnpm as solution states, but not working for yarn or npm for me.
Does anybody know the issue in detail here?
Mainly asking because the other 2 version managers (npm and yarn) should work too. For example I use npm in my computer mainly and I would like to keep using it instead of using 2 version managers in same system (npm and pnpm).
Having same issue as you mentioned (paste it here):
✖ Cannot use GraphQLScalarType "Int" from another module or realm.
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.
https://yarnpkg.com/en/docs/selective-version-resolutions
Duplicate "graphql" modules cannot be used at the same time since different
versions may have different capabilities and behavior. The data from one
version used in the function from another could produce confusing and
spurious results.
I also used resolutions to use only one version of graphql and same issue (and checked that I had one version installed only in my project).
Was anybody able to install and run composedb successfully using npm or yarn?