Skip to content

bug(desktop): Node crypto stalls renderer startup #4700

Description

@Phoenix500526

What happened

Running Desktop from current main leaves the window on the preload skeleton
indefinitely. The renderer fails before React mounts. Desktop should finish
loading and show the application shell.

The regression was introduced by #4490 (9e1ad2ed5), which added a
node:crypto value import to the browser-consumed
@maka/runtime-host/protocol entry point.

How to reproduce

  1. Check out main at 106891630 or later.
  2. Install and build the workspace dependencies.
  3. Start Desktop with the normal development command.
  4. Observe that the window remains on the preload skeleton.
  5. Open the renderer DevTools console.

Environment

  • Maka commit: 106891630
  • OS: macOS 26.6.2 (25G83), Apple Silicon
  • Surface: Desktop development build
  • Node.js: v24.16.0

Logs, screenshots, or additional context

The first renderer error is:

Uncaught Error: Module "node:crypto" has been externalized for browser
compatibility. Cannot access "node:crypto.createHash" in client code.

The stack starts at
packages/runtime-host/dist/protocol/client-capability.js:1:50.

@maka/runtime-host/protocol is imported by renderer modules for shared
protocol constants and decoders. Adding createHash at module scope makes the
entire protocol barrel unsafe to evaluate in Vite's browser target, even when
the renderer never calls clientCapabilityEntityId.

A fix should keep Node-only hashing out of the browser-consumed protocol
module rather than polyfilling Node crypto in the renderer. A regression check
should exercise the renderer bundle or otherwise reject Node built-ins from
browser-reachable value imports.

Related historical fixes: #1734 and #1847.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions