Skip to content

[Bug]: Nightly desktop backend crash-loops due to missing ffi-rs native optional dependency (WORKAROUND INCLUDED) #3104

@StiensWout

Description

@StiensWout

Summary

Windows nightly desktop builds can launch the Electron shell but never open the main app window because the packaged backend crash-loops before readiness.

The backend stderr in %USERPROFILE%\.t3\userdata\logs\server-child.log shows:

Error: Cannot find module '@yuuang/ffi-rs-win32-x64-msvc'
Require stack:
- ...\resources\app.asar\node_modules\ffi-rs\index.js

Environment

  • OS: Windows
  • App: T3 Code nightly desktop build
  • Backend Node: v24.15.0

Root Cause

Current main includes @ff-labs/fff-node in apps/server, which depends on ffi-rs.

ffi-rs resolves its platform binary through optional dependencies, including:

  • @yuuang/ffi-rs-win32-x64-msvc

The desktop artifact build stages production dependencies with:

vp install --prod --no-optional

That excludes the native optional package from the packaged app. On Windows, ffi-rs then fails at startup, the backend exits with code 1, and the desktop window is never created because backend readiness is never reached.

Expected Behavior

The Windows desktop package includes the native optional dependency needed by ffi-rs, so the backend reaches readiness and the main window opens.

Actual Behavior

The backend repeatedly exits with MODULE_NOT_FOUND for @yuuang/ffi-rs-win32-x64-msvc.

Suggested Fix

Do not pass --no-optional when installing staged desktop production dependencies. Platform-native optional packages are required runtime dependencies for packages like ffi-rs.

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