Skip to content

fix(dependencies): vendored better-sqlite3 copies ship x86_64-only prebuilds — breaks ARM64/Termux #8669

Description

@diegosouzapw

Bug Report

Source: Discussion #6573, reported by @sonnysin805-bit

Environment

  • Platform: Termux (Android), aarch64 (ARM64)
  • Node.js: v24.17.0
  • Install method: pnpm install -g omniroute
  • OmniRoute version: 3.8.48 (also reproduced on 3.8.44/3.0.0)

Problem

The app bundles multiple internal copies of better-sqlite3 under different nested paths inside node_modules/omniroute/app/node_modules/better-sqlite3 (observed versions 12.6.2 and 12.8.0, differing from the top-level dependency's 12.11.1). These vendored copies contain only a prebuilt .node binary compiled for EM_X86_64, with no binding.gyp, src/, or build/ scaffolding — so they cannot be rebuilt for EM_AARCH64.

Error

[proxyLogger] Failed to load from DB: dlopen failed: ".../better-sqlite3/build/Release/better_sqlite3.node" is for EM_X86_64 (62) instead of EM_AARCH64 (183)
[Middleware] settings_error: Settings read failed: dlopen failed: ...same...
[AUTH] Login failed: TypeError: Cannot read properties of undefined (reading 'safeParse')

Proposed Fix

The packaging/build process should either:

  1. (a) Dedupe to a single better-sqlite3 instance across the app bundle (eliminate vendored copies)
  2. (b) Include full source (or platform-appropriate prebuilds for arm64/android) in all vendored copies

Additional Context

  • Discussion: Omniroute Internal Server Error #6573 (22-comment mega-thread tracing multiple Termux issues)
  • npm install OOMs on Termux; pnpm install works (suggests install graph is heavier than necessary)
  • Top-level better-sqlite3@12.11.1 builds correctly for aarch64 — only the vendored copies are broken

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdependenciesPull requests that update a dependency filenodejs

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions