Repository navigation
fix(cli): install what a Remix app imports, report a broken build, keep .wrangler out of git - #1031
Merged
Merged
Conversation
…ep .wrangler out of git - Before Expo starts, the app's code (not server/, node_modules) is scanned for bare imports that are neither declared nor installed (a Remix export: the players supply platform modules, so package.json missed expo-clipboard / expo-sqlite). Real npm packages are installed with `expo install` (SDK versions; this adds them to package.json, logged). Path aliases (tsconfig paths, babel module-resolver), built-ins and non-npm names are skipped. - Before preview_ready, the page AND its entry script (Metro bundle / Vite module entry) are fetched: a build error is a preview_error with Metro's own message instead of a white page announced as ready. Slow is never broken. - .wrangler/ and .codeam/ (but a committed .codeam/preview.json) go to .git/info/exclude, never the user's .gitignore; .wrangler/ is also in the review-ignore list so the change card doesn't count it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Live on the owner's codespace (2.76.50), detection, wrangler and the tunnel all came up, but the page was white. Metro answered the bundle with 500 "Unable to resolve module expo-clipboard": the Remix players supply platform modules, so the exported package.json never declared it. The panel showed nothing, the post-turn card said "still responding", and
.wrangler/+.codeam/showed up as 21 changed files.What
missing-imports.ts: scans the app's bare imports (skips server/, node_modules, path aliases from tsconfigpathsand babelmodule-resolver, and built-ins). Real npm packages that are neither declared nor installed get installed with the project'sexpo install … -- --legacy-peer-deps. This writes package.json, and the log says so.bundle-health.ts: beforepreview_ready, Expo and Vite get the page and its entry script. A 4xx/5xx turns intopreview_error"Your app didn't build:\n<Metro's message>" and stops the preview. A timeout is never reported as a failure..git/info/excludegets/.wrangler/,/.codeam/*,!/.codeam/preview.json. The user's.gitignoreis never touched..wrangler/is also added to the review-ignore list.The post-turn "still responding" probe lives in api-v2 (
GET /api/preview/sessions/:id/reachable) and is fixed in a separate codeagent-mobile PR.Tests
New
missing-imports-bundle-health.test.ts. Preview + turn-files suites: 568 passed.tscis clean. Run live on a local Expo fixture:expo-clipboardwas installed at~8.0.8, the preview came up, and a missing module producedpreview_errorwith Metro's text.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.