Recently I upgraded to Redwood 6.1.0. I believe I followed all the instructions and everything seemed to go well at first. When I ran ‘yarn rw dev’ and got the following error in the console.
api | Importing Server Functions...
api | 14:18:58 🌲 Subscriptions are disabled.
api | /auth 2 ms
api | Took 2324 ms
api | API listening on http://localhost:8911/
api | GraphQL endpoint at /graphql
api | 14:18:58 🌲 Server listening at http://[::]:8911
api | 14:18:58 🐛 GraphiQL and Introspection Config
api | 🗒 Custom
api | {
api | "defaultAllowedOperations": [
api | "query",
api | "mutation"
api | ],
api | "defaultError": "Something went wrong.",
api | "disableIntrospection": false,
api | "disableGraphQL": false,
api | "graphiql": {
api | "title": "Redwood GraphQL Playground",
api | "headers": "{\"x-auth-comment\": \"See documentation: https://redwoodjs.com/docs/cli-commands#setup-graphiql-headers on how to auto generate auth headers\"}",
api | "defaultQuery": "query Redwood {\n redwood {\n version\n }\n }",
api | "headerEditorEnabled": true
api | },
api | "graphiQLEndpoint": "/graphql"
api | }
api | Error: Cannot use GraphQLSchema "{ __validationErrors: undefined, description: undefined, extensions: {}, astNode: { kind: "SchemaDefinition", description: undefined, directives: [], operationTypes: [Array], loc: [Object] }, extensionASTNodes: [], _queryType: Query, _mutationType: Mutation, _subscriptionType: undefined, _directives: [@requireAuth, @skipAuth, @include, @skip, @deprecated, @specifiedBy], _typeMap: { BigInt: BigInt, Date: Date, Time: Time, DateTime: DateTime, JSON: JSON, JSONObject: JSONObject, Redwood: Redwood, String: String, Query: Query, Int: Int, UserRole: UserRole, CreateUserRoleInput: CreateUserRoleInput, UpdateUserRoleInput: UpdateUserRoleInput, Mutation: Mutation, User: User, CreateUserInput: CreateUserInput, UpdateUserInput: UpdateUserInput, 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.
api |
api | Ensure that there is only one instance of "graphql" in the node_modules
api | directory. If different versions of "graphql" are the dependencies of other
api | relied on modules, use "resolutions" to ensure only one version is installed.
api |
api | https://yarnpkg.com/en/docs/selective-version-resolutions
api |
api | Duplicate "graphql" modules cannot be used at the same time since different
api | versions may have different capabilities and behavior. The data from one
api | version used in the function from another could produce confusing and
api | spurious results.
api | at instanceOf (C:\Kosmos\app\node_modules\graphql\jsutils\instanceOf.js:43:19)
api | at isSchema (C:\Kosmos\app\node_modules\graphql\type\schema.js:32:37)
api | at useSchema (C:\Kosmos\app\node_modules\graphql-yoga\cjs\plugins\use-schema.js:9:32)
api | at new YogaServer (C:\Kosmos\app\node_modules\graphql-yoga\cjs\server.js:159:64)
api | at createYoga (C:\Kosmos\app\node_modules\graphql-yoga\cjs\server.js:329:20)
api | at createGraphQLYoga (C:\Kosmos\app\node_modules\@redwoodjs\graphql-server\dist\createGraphQLYoga.js:173:46)
api | at createGraphQLHandler (C:\Kosmos\app\node_modules\@redwoodjs\graphql-server\dist\functions\graphql.js:51:48)
api | at Object.<anonymous> (C:\Kosmos\app\api\src\functions\graphql.js:12:24)
api | at Module._compile (node:internal/modules/cjs/loader:1105:14)
api | at Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
api |
api | Node.js v18.2.0
According to the error message there are duplicate graphql modules. In my nodes_modules I have the following:
...
...
@graphql-codegen
@graphql-eslint
@graphql-tools
@graphql-typed-document-node
@graphql-yoga
...
...
graphql
graphql-config
graphql-depth-limit
graphql-request
graphql-scalars
graphql-tag
graphql-ws
graphql-yoga
...
...
I’ve tried several things to resolve this issue:
- Deleted the nodes_modules directory and ran yarn install
- Reverted back to the version before I attempted the upgrade, performed the upgrade steps again
- Manually deleted the graphql directory
I’m at a loss now. Any suggestions will be greatly appreciated.