y-redis icon indicating copy to clipboard operation
y-redis copied to clipboard

Dockerfile configuration uses lts image causing server and worker to fail

Open AIRoboCoder opened this issue 1 year ago • 0 comments

Describe the bug

Dockerfile configuration uses an lts image that upgraded node to v22.11.0 causing server and worker to fail:

When running either the auth-express demo or the project in docker the Dockerfile configuration causes the following errors from worker and server regarding uWS.js only supporting up to node LTS version 20:

worker-1 | /usr/src/app/node_modules/uws/uws.js:22 worker-1 | throw new 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).\n\n' + e.toString()); worker-1 | ^ worker-1 | worker-1 | 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). worker-1 | worker-1 | Error: Cannot find module './uws_linux_x64_127.node' worker-1 | Require stack: worker-1 | - /usr/src/app/node_modules/uws/uws.js worker-1 | at /usr/src/app/node_modules/uws/uws.js:22:9 worker-1 | at Object. (/usr/src/app/node_modules/uws/uws.js:24:3) worker-1 | at Module._compile (node:internal/modules/cjs/loader:1546:14) worker-1 | at Object..js (node:internal/modules/cjs/loader:1689:10) worker-1 | at Module.load (node:internal/modules/cjs/loader:1318:32) worker-1 | at Function._load (node:internal/modules/cjs/loader:1128:12) worker-1 | at TracingChannel.traceSync (node:diagnostics_channel:315:14) worker-1 | at wrapModuleLoad (node:internal/modules/cjs/loader:218:24) worker-1 | at cjsLoader (node:internal/modules/esm/translators:263:5) worker-1 | at ModuleWrap. (node:internal/modules/esm/translators:196:7) worker-1 | worker-1 | Node.js v22.11.0 server-1 | /usr/src/app/node_modules/uws/uws.js:22 server-1 | throw new 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).\n\n' + e.toString()); server-1 | ^ server-1 | server-1 | 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). server-1 | server-1 | Error: Cannot find module './uws_linux_x64_127.node' server-1 | Require stack: server-1 | - /usr/src/app/node_modules/uws/uws.js server-1 | at /usr/src/app/node_modules/uws/uws.js:22:9 server-1 | at Object. (/usr/src/app/node_modules/uws/uws.js:24:3) server-1 | at Module._compile (node:internal/modules/cjs/loader:1546:14) server-1 | at Object..js (node:internal/modules/cjs/loader:1689:10) server-1 | at Module.load (node:internal/modules/cjs/loader:1318:32) server-1 | at Function._load (node:internal/modules/cjs/loader:1128:12) server-1 | at TracingChannel.traceSync (node:diagnostics_channel:315:14) server-1 | at wrapModuleLoad (node:internal/modules/cjs/loader:218:24) server-1 | at cjsLoader (node:internal/modules/esm/translators:263:5) server-1 | at ModuleWrap. (node:internal/modules/esm/translators:196:7) server-1 | server-1 | Node.js v22.11.0 worker-1 exited with code 1

To Reproduce

Steps to reproduce the behavior:

  1. Run docker compose up --build in project root or in demos/auth-express
  2. Observer docker errorlog

Expected behavior

Run the server and worker without uWS.js version error and not exiting

Proposed Solution

Change in both Dockerfiles the following line

FROM node:lts-alpine3.19

to

FROM node:20.17-alpine3.19

solves the issue.

Environment Information

Node version in lts-alpine.319: v22.11.0 Node version in 20.17-alpine3.19: v20.17.0

Tried this in 2 different environments: Fedora 39 linux: Docker version 27.3.1, build ce12230 Windows 10: Docker version 27.1.1, build 6312585

Output of npm ls yjs:

@y/[email protected] ├─┬ [email protected] │ ├─┬ [email protected] │ │ └── [email protected] deduped │ ├─┬ [email protected] │ │ └── [email protected] deduped │ └── [email protected] deduped └── [email protected]

Additional context Curious about a NestJS & TypeScript variant of y-redis

  • [ ] I'm a sponsor 💖
  • [ ] This issue is a blocker for my project.
  • [X] I considering contributing code to this project

AIRoboCoder avatar Oct 30 '24 07:10 AIRoboCoder