Skip to content

Please Recommend a Node Version to Compile With #18

Closed
@sraza-onshape

Description

@sraza-onshape

Hello, I am facing errors while trying to run yarn start-multiple-sources using Node v18. However, I believe the issue is not necessarily in the source code, but is expected to occur in the version of Node I have, 18.13.

What version of node was this tutorial originally developed with?

For more context, here are the error logs I see with export DEBUB=1:

$ yarn workspaces foreach run build
noop
noop
noop
noop
Done in 1s 554ms
$ yarn start-multiple-sources
[1] 🧘 Yoga - 🐛 Setting up server.
[1] 🧘 Yoga - 💡 GraphQL Server running at http://0.0.0.0:3004/graphql.
[0] server is running on 0.0.0.0:3003
[3] 🕸️ - GetMesh: Getting subschemas from source handlers
[3] 🕸️ - Books: Generating the schema
[3] 🕸️ - Authors: Generating the schema
[3] 🕸️ - Authors: Getting channel credentials
[3] 🕸️ - Authors: Using insecure connection
[3] 🕸️ - Stores: Generating the schema
[3] 🕸️ - Server: Generating the unified schema...
[3] 🕸️ - Authors: Getting stored root and decoded descriptor set objects
[3] 🕸️ - Books: Reading ../books-service/openapi3-definition.json from the file system
[3] 🕸️ - Authors: Building Roots
[3] 🕸️ - Authors: Using proto file(s)
[3] 🕸️ - Authors: Loading proto files(../authors-service/proto/authors/v1/authors_service.proto); 
[3]  ../authors-service/proto/authors/v1/authors_service.proto 
[1] 🧘 Yoga - 🐛 Node Request received
[3] 🕸️ - Books - translation: Options: { strict: false, report: { warnings: [], numOps: 0, numOpsQuery: 0, numOpsMutation: 0, numOpsSubscription: 0, numQueriesCreated: 0, numMutationsCreated: 0, numSubscriptionsCreated: 0 }, operationIdFieldNames: false, fillEmptyResponses: true, addLimitArgument: true, idFormats: undefined, selectQueryOrMutationField: {}, genericPayloadArgName: false, simpleNames: false, singularNames: false, includeHttpDetails: false, headers: undefined, qs: undefined, requestOptions: undefined, connectOptions: undefined, baseUrl: "http://localhost:3002/", customResolvers: undefined, fetch: [function], resolverMiddleware: [function resolverMiddleware], pubsub: { subIdListenerMap: {}, listenerEventMap: {}, eventNameListenersMap: {} }, viewer: false, tokenJSONpath: undefined, sendOAuthTokenInQuery: true, provideErrorExtensions: true, equivalentToMessages: true, logger: { name: "🕸️ - Books" } }
[3] 🕸️ - Books - translation: Process operation 'GET /books'...
[3] 🕸️ - Books - translation: Create GraphQLList 'Books'
[3] 🕸️ - Books - translation: Create object type 'Book' (for operation 'GET /books')
[3] 🕸️ - Books - translation: Process operation 'GET /categories'...
[3] 🕸️ - Books - translation: Create GraphQLList 'Categories'
[3] 🕸️ - Books - translation: Create object type 'Category' (for operation 'GET /categories')
[3] 🕸️ - Books - translation: Process operation 'GET /books/{id}'...
[3] 🕸️ - Books - translation: Reuse object type 'Book' (for operation 'GET /books/{id}')
[1] node:internal/deps/undici/undici:7225
[1]             throw new TypeError("RequestInit: duplex option is required when sending a body.");
[1]                   ^
[1] 
[1] TypeError: RequestInit: duplex option is required when sending a body.
[1]     at new Request (node:internal/deps/undici/undici:7225:19)
[1]     at getNodeRequest (/Users/sraza/repos/graphql-mesh-docs-first-gateway/packages/stores-service/dist/index.js:43254:10)
[1]     at YogaNodeServer.handleIncomingMessage (/Users/sraza/repos/graphql-mesh-docs-first-gateway/packages/stores-service/dist/index.js:43336:21)
[1]     at YogaNodeServer.requestListener (/Users/sraza/repos/graphql-mesh-docs-first-gateway/packages/stores-service/dist/index.js:43304:35)
[1]     at Server.emit (node:events:512:28)
[1]     at parserOnIncoming (node:_http_server:1086:12)
[1]     at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17)
[1] 
[1] Node.js v19.8.1
[3] 🕸️ - Books: The schema has been generated successfully
[3] 🕸️ - Books: Analyzing transforms
[3] 🕸️ - Authors: Adding proto content to the root
[3] 🕸️ - Authors - Root0: Resolving entire the root tree
[3] 🕸️ - Authors - Root0: Creating artifacts from descriptor set and root
[3] 🕸️ - Authors - Root0: Creating package definition from file descriptor set object
[3] 🕸️ - Authors: Failed to generate the schema TypeError: Cannot read properties of undefined (reading 'add')
[3]     at Function.fromDescriptor (/Users/sraza/repos/graphql-mesh-docs-first-gateway/packages/multiple-sources/node_modules/@graphql-mesh/grpc/node_modules/@grpc/proto-loader/node_modules/protobufjs/ext/descriptor/index.js:219:66)
[3]     at Function.fromDescriptor (/Users/sraza/repos/graphql-mesh-docs-first-gateway/packages/multiple-sources/node_modules/@graphql-mesh/grpc/node_modules/@grpc/proto-loader/node_modules/protobufjs/ext/descriptor/index.js:92:42)
[3]     at createPackageDefinitionFromDescriptorSet (/Users/sraza/repos/graphql-mesh-docs-first-gateway/packages/multiple-sources/node_modules/@graphql-mesh/grpc/node_modules/@grpc/proto-loader/build/src/index.js:159:32)
[3]     at Object.loadFileDescriptorSetFromObject (/Users/sraza/repos/graphql-mesh-docs-first-gateway/packages/multiple-sources/node_modules/@graphql-mesh/grpc/node_modules/@grpc/proto-loader/build/src/index.js:214:12)
[3]     at GrpcHandler.getMeshSource (/Users/sraza/repos/graphql-mesh-docs-first-gateway/packages/multiple-sources/node_modules/@graphql-mesh/grpc/index.js:502:51)
[3]     at async /Users/sraza/repos/graphql-mesh-docs-first-gateway/packages/multiple-sources/node_modules/@graphql-mesh/runtime/index.js:39:28
[3]     at async Promise.allSettled (index 1)
[3]     at async Object.getMesh (/Users/sraza/repos/graphql-mesh-docs-first-gateway/packages/multiple-sources/node_modules/@graphql-mesh/runtime/index.js:34:5)
[3] 🕸️ - Stores: Failed to generate the schema Error: Failed to fetch introspection from http://0.0.0.0:3004/graphql: TypeError: fetch failed;
[3]  TypeError: fetch failed
[3]     at Object.fetch (node:internal/deps/undici/undici:11457:11)
[3]     at async /Users/sraza/repos/graphql-mesh-docs-first-gateway/packages/multiple-sources/node_modules/@graphql-mesh/graphql/node_modules/fetchache/index.js:21:30
[3]     at async Object.getWithSet (/Users/sraza/repos/graphql-mesh-docs-first-gateway/packages/multiple-sources/node_modules/@graphql-mesh/store/index.js:151:38)
[3]     at async Promise.allSettled (index 0)
[3]     at async GraphQLHandler.getMeshSource (/Users/sraza/repos/graphql-mesh-docs-first-gateway/packages/multiple-sources/node_modules/@graphql-mesh/graphql/index.js:217:52)
[3]     at async /Users/sraza/repos/graphql-mesh-docs-first-gateway/packages/multiple-sources/node_modules/@graphql-mesh/runtime/index.js:39:28
[3]     at async Promise.allSettled (index 2)
[3]     at async Object.getMesh (/Users/sraza/repos/graphql-mesh-docs-first-gateway/packages/multiple-sources/node_modules/@graphql-mesh/runtime/index.js:34:5)
[3]     at GraphQLHandler.getMeshSource (/Users/sraza/repos/graphql-mesh-docs-first-gateway/packages/multiple-sources/node_modules/@graphql-mesh/graphql/index.js:222:23)
[3]     at async /Users/sraza/repos/graphql-mesh-docs-first-gateway/packages/multiple-sources/node_modules/@graphql-mesh/runtime/index.js:39:28
[3]     at async Promise.allSettled (index 2)
[3]     at async Object.getMesh (/Users/sraza/repos/graphql-mesh-docs-first-gateway/packages/multiple-sources/node_modules/@graphql-mesh/runtime/index.js:34:5)
[3] 🕸️: An error occured while writing the schema file: Error: Schemas couldn't be generated successfully. Check for the logs by running Mesh with DEBUG=1 environmental variable to get more verbose output.
[3]     at Object.getMesh (/Users/sraza/repos/graphql-mesh-docs-first-gateway/packages/multiple-sources/node_modules/@graphql-mesh/runtime/index.js:69:15)
[3] 🕸️: An error occurred while building the artifacts: Error: Schemas couldn't be generated successfully. Check for the logs by running Mesh with DEBUG=1 environmental variable to get more verbose output.
[3]     at Object.getMesh (/Users/sraza/repos/graphql-mesh-docs-first-gateway/packages/multiple-sources/node_modules/@graphql-mesh/runtime/index.js:69:15)
[3] 🕸️ - Server: Error: Schemas couldn't be generated successfully. Check for the logs by running Mesh with DEBUG=1 environmental variable to get more verbose output.
[3]     at Object.getMesh (/Users/sraza/repos/graphql-mesh-docs-first-gateway/packages/multiple-sources/node_modules/@graphql-mesh/runtime/index.js:69:15)
[3] Error: Schemas couldn't be generated successfully. Check for the logs by running Mesh with DEBUG=1 environmental variable to get more verbose output.
[3]     at Object.getMesh (/Users/sraza/repos/graphql-mesh-docs-first-gateway/packages/multiple-sources/node_modules/@graphql-mesh/runtime/index.js:69:15)
[1] yarn workspace stores-service start exited with code 1
--> Sending SIGTERM to other processes..
[3] yarn workspace mesh-multiple-sources start exited with code 1
--> Sending SIGTERM to other processes..
[0] yarn workspace authors-service start exited with code 129
--> Sending SIGTERM to other processes..
[2] yarn workspace books-service start exited with code 129

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions