You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The server should start, just like if it was started with bun run
What do you see instead?
./server
47766 | var _value$constructor;
47767 | const className = constructor.prototype[Symbol.toStringTag];
47768 | const valueClassName = Symbol.toStringTag in value ? value[Symbol.toStringTag] : (_value$constructor = value.constructor) === null || _value$constructor === undefined ? undefined : _value$constructor.name;
47769 | if (className === valueClassName) {
47770 | const stringifiedValue = inspect(value);
47771 | throw new Error(`Cannot use ${className} "${stringifiedValue}" 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.`);
error: Cannot use GraphQLSchema "{ __validationErrors: [], description: undefined, extensions: {}, astNode: undefined, extensionASTNodes: [], _queryType: Query, _mutationType: undefined, _subscriptionType: undefined, _directives: [@include, @skip, @deprecated, @specifiedBy], _typeMap: { Query: Query, String: String, Boolean: Boolean, __Schema: __Schema, __Type: __Type, __TypeKind: __TypeKind, __Field: __Field, __InputValue: __InputValue, __EnumValue: __EnumValue, __Directive: __Directive, __DirectiveLocation: __DirectiveLocation }, _subTypeMap: {}, _implementationsMap: {} }" 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.
at instanceOf3 (/$bunfs/root/server:47771:13)
at useSchema (/$bunfs/root/server:54237:7)
at new YogaServer (/$bunfs/root/server:59831:28)
at createYoga (/$bunfs/root/server:59763:19)
at /$bunfs/root/server:60056:12
Additional information
This could be related to #3659 where a similar error came up. I've tried the reproduction repo from the referenced issue and with the setup in the repo everything works fine when using bun build. The trouble starts when I try to use graphql-yoga.
I've also tried with @apollo/server -> doesn't work, same error.
The text was updated successfully, but these errors were encountered:
The graphql schema is directly created using graphql.createSchema and I don't think that there is any code generation involved. Compared to this repo where everything works fine, I only added graphql-yoga.
Setting BUN_JSC_dumpModuleLoadingState=1 does not change the output of bun build or from running the built binary for me.
I think I have a similar issue. Types that I import from "graphql" are not the same instances that "graphql-compose" imports internally from "graphql". Bun 1.1.13 on windows 11
same issue with gql.tada
trying to run the gql.tada check result in an error saying there is multiple instances of graphql (even after adding overrides or resolutions to a single graphql version.
EDIT: i looked into it with someone working on gql.tada and it seems that one of the deps use a graphql version that is too old and the override doesn't fix it.
What version of Bun is running?
1.1.12
What platform is your computer?
Darwin 23.5.0 arm64 arm
What steps can reproduce the bug?
bun install
bun build ./server.ts --compile --outfile server
./server
What is the expected behavior?
The server should start, just like if it was started with
bun run
What do you see instead?
Additional information
This could be related to #3659 where a similar error came up. I've tried the reproduction repo from the referenced issue and with the setup in the repo everything works fine when using
bun build
. The trouble starts when I try to usegraphql-yoga
.I've also tried with
@apollo/server
-> doesn't work, same error.The text was updated successfully, but these errors were encountered: