Public: anyone can read this; the crew can change it.

An app that stops with 'Cannot find module dist/server.js' says why on its page #17834

opened this

Merged 4h 27m ago, live in production

An app that dies on a missing entry file now fails with a plain sentence that names the cause and the fix. I did not find the forge-side cause, because I couldn't see the autobio, platos or trevato.dev logs from this sandbox. The tests for this change and tsc --noEmit pass; I did not run the full suite.

Notes

opened this

An app that dies on a missing entry file now fails with a plain sentence that names the cause and the fix. I did not find the forge-side cause, because I couldn't see the autobio, platos or trevato.dev logs from this sandbox. The tests for this change and tsc --noEmit pass; I did not run the full suite.

What changed

  • notFoundHint in src/apps/run_command.ts already adds a fix to start failures when the run command isn't found. It now also recognises a missing entry file, in both forms Bun prints: Cannot find module '…' and Module not found "dist/server.js".
  • For a file under dist/, build/, out/ or .output/, the error says it is a build output that isn't committed and that no step builds before run. It suggests committing it or building it in forge.json install (bun install && bun run build).
  • For any other missing file, it says to commit the file or point run at one that exists.
  • A missing package such as left-pad is left alone, because a path is needed to call it an entry file.
  • The sentence is appended to the start error. The page's failed state (servingWords) and the terminal screens already show that error, so both doors show it without further change.

Test: test/apps-compound-run.test.ts starts a real app with bun dist/server.js and with bun src/server.ts, neither present. Each start fails with the sentence, not the bare exit line. A second test checks that a missing package gets no entry-file hint.

Not done

  • I did not find why the preview of trevato.dev stops, so the "say it in the pull with the evidence from the app's log" item is open. The likely cause is that dist/ is neither committed nor built, since a preview checkout runs install then run. A person should confirm it from the app's log. If it holds, those apps need a build step in install, and the page now says so.
  • The forge never runs a build step itself. The hint only suggests one for the app to put in its own forge.json.

Reused: the existing notFoundHint path in process.ts. No new dependencies, no egress changes.

Closes #17830

commented

An app that dies on a missing entry file now fails with a plain sentence that names the cause and the fix. I did not find the forge-side cause, because I couldn't see the autobio, platos or trevato.dev logs from this sandbox. The tests for this change and tsc --noEmit pass; I did not run the full suite.

What changed

  • notFoundHint in src/apps/run_command.ts already adds a fix to start failures when the run command isn't found. It now also recognises a missing entry file, in both forms Bun prints: Cannot find module '…' and Module not found "dist/server.js".
  • For a file under dist/, build/, out/ or .output/, the error says it is a build output that isn't committed and that no step builds before run. It suggests committing it or building it in forge.json install (bun install && bun run build).
  • For any other missing file, it says to commit the file or point run at one that exists.
  • A missing package such as left-pad is left alone, because a path is needed to call it an entry file.
  • The sentence is appended to the start error. The page's failed state (servingWords) and the terminal screens already show that error, so both doors show it without further change.

Test: test/apps-compound-run.test.ts starts a real app with bun dist/server.js and with bun src/server.ts, neither present. Each start fails with the sentence, not the bare exit line. A second test checks that a missing package gets no entry-file hint.

Not done

  • I did not find why the preview of trevato.dev stops, so the "say it in the pull with the evidence from the app's log" item is open. The likely cause is that dist/ is neither committed nor built, since a preview checkout runs install then run. A person should confirm it from the app's log. If it holds, those apps need a build step in install, and the page now says so.
  • The forge never runs a build step itself. The hint only suggests one for the app to put in its own forge.json.

Reused: the existing notFoundHint path in process.ts. No new dependencies, no egress changes.

commented

Left #17830 open: 1 unticked item remain (Find in the forge why (build step skipped, dist not committed or not built in the preview, wrong cwd); say it in the pull with the evidence from the app's log.).

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs