ardatan / graphql-mesh

🕸️ GraphQL Federation Framework for any API services such as REST, OpenAPI, Swagger, SOAP, gRPC and more...
https://the-guild.dev/graphql/mesh
MIT License
3.27k stars 338 forks source link

uWebSockets.js version 20.35.0 is causing app startup issues #6392

Closed andrey-dubnik closed 9 months ago

andrey-dubnik commented 9 months ago

Issue workflow progress

Progress of the issue based on the Contributor Workflow

Make sure to fork this template and run yarn generate in the terminal.

Please make sure Mesh package versions under package.json matches yours.


Describe the bug

While following the standard installation guide and examples there was a failure (see below). The failure boils down to a very recent release of the uWebSockets.js 20.35.0 which does have some issues on Linux, MacOS (maybe some other platform). After changing the version to 20.34.0 the problem was gone.

uWebSockets.js is a dependency of the graphql-mesh/cli which uses semver uWebSockets.js "uNetworking/uWebSockets.js#semver:^20" meaning it will use whatever is 20.x and will pick up 20.35.0 as the latest release.

Error output

$ mesh dev
💡 🕸️  Mesh - Server Starting GraphQL Mesh...
💡 🕸️  Mesh - MyGraphQLApi Generating GraphQL schema from JSON Schemas
💥 🕸️  Mesh Error: This version of uWS.js supports only Node.js LTS versions 16, 18 and 20 on (glibc) Linux, macOS and Windows, on Tier 1 platforms (https://github.com/nodejs/node/blob/master/BUILDING.md#platform-list).

Error: Module did not self-register: '/workspaces/distributed-cache-gateway/node_modules/uWebSockets.js/uws_linux_x64_120.node'.
    at /workspaces/distributed-cache-gateway/node_modules/uWebSockets.js/uws.js:22:9
    at Object.<anonymous> (/workspaces/distributed-cache-gateway/node_modules/uWebSockets.js/uws.js:24:3)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Object.require.extensions.<computed> [as .js] (/workspaces/distributed-cache-gateway/node_modules/ts-node/src/index.ts:1608:43)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Function.Module._load (node:internal/modules/cjs/loader:1023:12)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at /workspaces/distributed-cache-gateway/node_modules/@graphql-mesh/cli/cjs/commands/serve/serve.js:132:85
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed.
Exit code: 1

To Reproduce Steps to reproduce the behavior:

Standard hello world installation

Expected behavior

It will help if flex versioning is replaced with a version guaranteed to work either explicitly or at least on a patch level (still does not protect the application from the entropy) e.g. uNetworking/uWebSockets.js#20.34.0 or uNetworking/uWebSockets.js#semver:~20.34

Environment:

Additional context

https://github.com/uNetworking/uWebSockets.js/issues/999

ardatan commented 9 months ago

Upstream issue has been fixed