Skip to content

🤖 fix: eliminate dev-server startup crash from tsgo/tsc-alias race#2612

Merged
ethanndickson merged 1 commit intomainfrom
dev-server-8q0p
Feb 25, 2026
Merged

🤖 fix: eliminate dev-server startup crash from tsgo/tsc-alias race#2612
ethanndickson merged 1 commit intomainfrom
dev-server-8q0p

Conversation

@ethanndickson
Copy link
Member

Summary

Fix the make dev-server startup crash (Cannot find module '@/node/config') that occurs on every cold start on non-Windows platforms.

Background

The non-Windows dev-server target launches tsgo -w and tsc-alias -w as independent parallel watchers. On startup, tsgo immediately rebuilds dist/ with unresolved @/ path aliases, and nodemon restarts the server after its 500ms delay — before tsc-alias finishes rewriting all ~415 files. This produces a transient MODULE_NOT_FOUND crash every time.

The Windows dev-server target already avoids this by using scripts/build-main-watch.js, which runs tsgo → tsc-alias sequentially.

Implementation

Replace the parallel watcher pair with a source-watching nodemon that executes the existing sequential build-main-watch.js script on each change — the same approach Windows already uses. This is a one-line Makefile change (plus a comment).

Validation

  • make build-main passes
  • make dev-server starts without the Cannot find module '@/node/config' crash
  • Source file changes trigger sequential rebuild → clean server restart

Generated with mux • Model: anthropic:claude-opus-4-6 • Thinking: xhigh • Cost: $2.23

Replace parallel tsgo -w + tsc-alias -w watchers with sequential
build-main-watch.js execution in non-Windows dev-server target.
The parallel watchers caused nodemon to restart mid-alias-rewrite,
producing transient 'Cannot find module @/node/config' crashes.
@ethanndickson ethanndickson added this pull request to the merge queue Feb 25, 2026
Merged via the queue into main with commit 7804f16 Feb 25, 2026
23 checks passed
@ethanndickson ethanndickson deleted the dev-server-8q0p branch February 25, 2026 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant