Strip ELECTRON_RUN_AS_NODE from desktop dev launch #187
Labels
No labels
abandoned
active
audit
blocked
data-safety
difficulty:easy
difficulty:hard
difficulty:high
difficulty:medium
docs
done
duplicate
notebook-v0
open
priority:high
ready
release-critical
safe-mode
spec
spec-backlog
subsystem:api
subsystem:backlog
subsystem:bases
subsystem:ci
subsystem:command
subsystem:configuration
subsystem:consolidate
subsystem:dependencies
subsystem:desktop-electron
subsystem:diffmerge
subsystem:docker
subsystem:docs
subsystem:fuzzy
subsystem:graph
subsystem:hotkeys
subsystem:lapis
subsystem:maint
subsystem:maintenance
subsystem:markdown
subsystem:markdown-lint
subsystem:md018
subsystem:notebook
subsystem:notifications
subsystem:opfs
subsystem:package
subsystem:plugin-markdown
subsystem:plugin-tasks
subsystem:plugins
subsystem:registry
subsystem:release
subsystem:renovate
subsystem:restore
subsystem:scripts
subsystem:search
subsystem:settings
subsystem:spec
subsystem:tasks
subsystem:testing
subsystem:ui
subsystem:web
subsystem:workspace
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lapis-notes/lapis#187
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
pnpm dev:desktopcan inheritELECTRON_RUN_AS_NODEfrom the invokingpackage-manager environment. When that happens, the dev orchestrator launches
the Electron binary as plain Node, so the desktop main process crashes before
the renderer can show the current dev UI.
Problem
Running:
starts Vite and compiles the Electron main/preload build, but the spawned
Electron process crashes with:
The same renderer and built main process work when Playwright launches Electron
through the existing helpers because those helpers strip
ELECTRON_RUN_AS_NODEbefore launch.
Goal
Make
pnpm dev:desktoplaunch the real Electron runtime consistently, includingwhen the parent shell, pnpm, Turbo, or test tooling has
ELECTRON_RUN_AS_NODEset.
Scope
packages/desktop-electron/scripts/dev.mjsto the spawned Electron process.behavior.
Node-mode Electron flag.
pnpm dev:desktopcommand by exercising the spawned Electronapp rather than only checking process logs.
terminal session does not keep Vite and TypeScript watchers alive.
LAPIS_DESKTOP_TEST_VAULT_PATH, debug-port probes, and related desktop envcontrols reach the package dev launcher from the repo-root command.
Non-goals
still running.
Acceptance Criteria
pnpm dev:desktopno longer launches Electron withELECTRON_RUN_AS_NODE.LAPIS_DESKTOP_TEST_VAULT_PATH=e2e-vault-temp, the command reaches thedesktop renderer instead of crashing in
dist-electron/main.js.e2e-vault-temp, the app can openSettings and render the Plugin registry tab.
pnpm dev:desktopshell commandto terminate cleanly instead of leaving the watcher process alive.
pnpm dev:desktopforwards theLAPIS_DESKTOP_*environmentvariables needed by desktop test-vault and verification flows.
Implementation Notes
createElectronLaunchEnv()already deletesELECTRON_RUN_AS_NODE; mirror that defensive behavior in the devorchestrator.
the issue look like a missing settings tab even though the settings
registration path passes when Electron launches correctly.
not automate the rendered UI state from the root
pnpm dev:desktopcommand.Add or use a command-level probe that starts the root script and inspects the
spawned Electron app.
process could exit immediately on the single-instance lock, leaving the
terminal watcher alive and focusing the installed app instead.
remote-debugging env var, so desktop dev env pass-through has to be explicit
at the root task level.
Suggested Files or Specs To Inspect
packages/desktop-electron/scripts/dev.mjspackages/desktop-electron/e2e/helpers.tspackages/desktop-electron/src-electron/main.tspackages/desktop-electron/e2e/plugin-registry.spec.tsturbo.jsonspec/src/20-packages/desktop-electron/index.mdValidation Commands
LAPIS_DESKTOP_TEST_VAULT_PATH=/Users/stevejuma/code/lapis-notes/e2e-vault-temp LAPIS_DESKTOP_DISABLE_DEVTOOLS=1 pnpm dev:desktoppnpm dev:desktop, opens Settings in thespawned Electron window, verifies the Plugin registry panel, closes Electron,
and verifies the shell process exits.
pnpm --filter @lapis-notes/desktop-electron check:allpnpm --filter @lapis-notes/desktop-electron check:e2eRelated Issues
Follow-up Tasks
Implementation Summary
Updated pnpm dev:desktop so Turbo forwards desktop test/debug env, the dev launcher strips Node-mode state while using an isolated repo-scoped userData directory, the macOS dev window close quits Electron/watchers, and verified the root command renders Plugin registry against e2e-vault-temp and exits cleanly.
Reopen Reason
Regression follow-up: pnpm dev:desktop still does not reliably render the expected Electron settings UI, and closing the Electron app leaves the dev shell running.