Termix-SSH / Termix-SSH/Support

[BUG] macOS x86_64 Desktop app stuck on loading spinner due to missing @img/sharp-darwin-x64 module

Open
#1,286 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug file-manager platform-desktop platform-macos
Dominant language
No language data
Stars
28
Forks
4
PR merge metrics
No merged PRs in 30d

Description

Platform

Desktop App - macOS

Server Installation Method

N/A

Version

2.7.1

CLI Installation Method

N/A

CLI Version

N/A

Troubleshooting
  • I have examined logs and tried to find the issue
  • I have reviewed opened and closed issues
  • I have tried restarting the application
  • I have checked open issues and ensured this is not a duplicate
The Problem

On macOS x86_64 (Intel Mac), launching Termix (installed via Mac App Store, version 2.7.1) results in an infinite spinning loading indicator. The UI never finishes loading. On Apple Silicon (arm64 / M-series Macs), the application launches and works normally.

Inspecting ~/Library/Containers/com.karmaa.termix/Data/Library/Application Support/termix/termix-main.log reveals that the embedded backend server crashes immediately upon initialization:

[backend:stderr] [ERROR] [🚀] Failed to initialize backend services [op:startup_failed]
[backend:stderr] Error: Could not load the "sharp" module using the darwin-x64 runtime
Possible solutions:
- Ensure optional dependencies can be installed:
    npm install --include=optional sharp
- Ensure your package manager supports multi-platform installation:
    See https://sharp.pixelplumbing.com/install#cross-platform
- Add platform-specific dependencies:
    npm install --os=darwin --cpu=x64 sharp
- Consult the installation documentation:
    See https://sharp.pixelplumbing.com/install
    at file:///Applications/Termix.app/Contents/Resources/app-x64.asar.unpacked/node_modules/sharp/dist/sharp.mjs:171:9
    at ModuleJob.run (node:internal/modules/esm/module_job:439:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:643:26)
    at async file:///Applications/Termix.app/Contents/Resources/app-x64.asar.unpacked/dist/backend/backend/starter.js:221:33
Backend process exited with code 1, signal null
startBackendServer result: false
Root Cause

In the macOS multi-arch package:
Inspecting /Applications/Termix.app/Contents/Resources/app-x64.asar.unpacked/node_modules/@img/:

  • Only contains:
    • @img/colour
    • @img/sharp-darwin-arm64 (wrong architecture bundled inside x64 package)
    • @img/sharp-libvips-darwin-arm64 (wrong architecture bundled inside x64 package)
  • The required x86_64 packages (@img/sharp-darwin-x64 and @img/sharp-libvips-darwin-x64) are missing.

Because database/routes/terminal.js imports sharp at top-level (import sharp from "sharp";), Node.js fails to initialize the module when importing database.js on x86_64, crashing the backend server. The Electron renderer window therefore never receives a connection on port 30001 and remains on the loading screen forever.

Manually installing @img/sharp-darwin-x64@0.35.3 and @img/sharp-libvips-darwin-x64@1.3.2 into app-x64.asar.unpacked/node_modules/@img/ completely resolves the issue and the app starts right up.

How to Reproduce
  1. Install Termix 2.7.1 from the Mac App Store on an Intel (x86_64) Mac.
  2. Launch Termix.
  3. Observe the loading spinner rotating infinitely without the UI appearing.
Additional Context

Suggested improvements:

  1. Build packaging: When building multi-arch packages (especially on an Apple Silicon host machine), ensure npm/electron-builder downloads @img/sharp-darwin-x64 and @img/sharp-libvips-darwin-x64 for the x64 bundle.
  2. Defensive loading: In database/routes/terminal.js, consider lazily/dynamically importing sharp (or wrapping it in a try/catch), so an issue with image normalization does not prevent the entire terminal/SSH backend server from starting.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the multi-arch packaging configuration and database/routes/terminal.js, focusing on how sharp and its platform-specific packages are included. Reproduce the launch on an Intel macOS build and verify that the x64 package contains the required @img modules and that backend startup is not blocked by image normalization. Done means the 2.7.1-equivalent x86_64 app reaches the UI instead of remaining on the loading spinner.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, javascript, macos
Domain
backend, build-system, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.