Skip to content

Unable to start Rocket.Chat 7.13.0 due to sharp module error #37705

@ymch

Description

@ymch

Description:

After upgrading from 7.12.2 to 7.13.0, Rocket.Chat does not start and exits with a sharp module loading error.

I noticed a difference in behavior between 7.12.2 and 7.13.0 with regard to how the sharp dependency is handled.
On the same system and with the same Node.js version (22.16.0), version 7.12.2 starts normally, while 7.13.0 stops during startup.

Both tarballs (7.12.2 and 7.13.0) include only the source version of sharp (without a prebuilt native binary), so I am not sure whether this change in behavior is intentional or not. It may also be related to how optional dependencies are processed in 7.13.0.

I am opening this issue in case this difference is unexpected.

Steps to reproduce:

  1. Use Node.js 22.16.0
  2. Extract Rocket.Chat 7.12.2 (tar deployment)
  3. Note that programs/server/npm/node_modules/sharp/ contains only source files (no build/Release/*.node)
  4. Start Rocket.Chat → it starts normally
  5. Replace installation with Rocket.Chat 7.13.0 (tar deployment)
  6. Start Rocket.Chat → it exits with a sharp module loading error

Expected behavior:

Rocket.Chat would start normally, similar to version 7.12.2, even when the prebuilt sharp binary is not present.

Actual behavior:

Rocket.Chat 7.13.0 stops during startup with the following error:

Error: Could not load the "sharp" module using the linux-x64 runtime
Possible solutions:
- Ensure optional dependencies can be installed:
  npm install --include=optional sharp
- Ensure your package manager supports multi-platform installation:
  ...
Node.js v22.16.0

Full log is included below.

Server Setup Information:

  • Version of Rocket.Chat Server: 7.13.0
  • Previous Version: 7.12.2
  • License Type: Community
  • Number of Users: 20
  • Operating System: Rocky Linux 9.7
  • Deployment Method: tar
  • Number of Running Instances: 1
  • DB Replicaset Oplog: enabled
  • NodeJS Version: 22.16.0
  • Deno: 1.43.5
  • MongoDB Version: 6.0.26 (wiredTiger, oplog enabled)

Additional information

I examined both tar distributions (7.12.2 and 7.13.0) and found that the following directory:
programs/server/npm/node_modules/sharp/

  • LICENSE
  • README.md
  • package.json
  • install/
  • lib/
  • src/

but does not contain:

  • build/Release/
  • sharp-linux-x64.node

I am not sure whether this is an intentional change in sharp handling or a possible regression, so I would appreciate any guidance.

Relevant logs:

rocketchat[928]: Database watchers is enabled and this is not the default option.
rocketchat[928]: Rocket.Chat deprecated the usage of `oplog/change streams` and are going to remove it the next major version (8.0.0).
rocketchat[928]: packages/core-runtime.js:189
rocketchat[928]:            throw error;
rocketchat[928]:            ^
rocketchat[928]: Error: Could not load the "sharp" module using the linux-x64 runtime
rocketchat[928]: Possible solutions:
rocketchat[928]: - Ensure optional dependencies can be installed:
rocketchat[928]:    npm install --include=optional sharp
rocketchat[928]: - Ensure your package manager supports multi-platform installation:
rocketchat[928]:    See https://sharp.pixelplumbing.com/install#cross-platform
rocketchat[928]: - Add platform-specific dependencies:
rocketchat[928]:    npm install --os=linux --cpu=x64 sharp
rocketchat[928]: - Consult the installation documentation:
rocketchat[928]:    See https://sharp.pixelplumbing.com/install
rocketchat[928]:    at Object.<anonymous> (/opt/Rocket.Chat/programs/server/npm/node_modules/sharp/lib/sharp.js:113:9)
rocketchat[928]:    at Module.<anonymous> (node:internal/modules/cjs/loader:1730:14)
rocketchat[928]:    at Module.Mp._compile (/tools/static-assets/server/runtime.js:91:21)
rocketchat[928]:    at Object..js (node:internal/modules/cjs/loader:1895:10)
rocketchat[928]:    at Module.<anonymous> (node:internal/modules/cjs/loader:1465:32)
rocketchat[928]:    at Module.Mp.load (/tools/static-assets/server/runtime.js:35:31)
rocketchat[928]:    at Function._load (node:internal/modules/cjs/loader:1282:12)
rocketchat[928]:    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
rocketchat[928]:    at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
rocketchat[928]:    at Module.<anonymous> (node:internal/modules/cjs/loader:1487:12)
rocketchat[928]:    at Module.mod.require (/opt/Rocket.Chat/programs/server/node_modules/@meteorjs/reify/lib/runtime/index.js:30:33)
rocketchat[928]:    at require (node:internal/modules/helpers:135:16)
rocketchat[928]:    at Object.<anonymous> (/opt/Rocket.Chat/programs/server/npm/node_modules/sharp/lib/constructor.js:10:1)
rocketchat[928]:    at Module.<anonymous> (node:internal/modules/cjs/loader:1730:14)
rocketchat[928]:    at Module.Mp._compile (/tools/static-assets/server/runtime.js:91:21)
rocketchat[928]:    at Object..js (node:internal/modules/cjs/loader:1895:10)
rocketchat[928]: Node.js v22.16.0
systemd[1]: rocketchat.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: rocketchat.service: Failed with result 'exit-code'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions