Commit e7277e0
committed
fix(mobile): make the Expo web preview actually render (self-healing dev server)
The in-panel mobile web preview never rendered. Four compounding causes,
each fixed deterministically at the dev-server layer so it works regardless
of how the model builds the app:
1. Scaffold nesting: `cp -a template dir` nests when the run-start mkdir has
already created `dir` (dir/cheatcode-expo-template/), so the project had no
package.json at its root and fell back to a bare create-expo-app missing
expo-router + the web deps. Copy template CONTENTS and verify package.json.
2. Broken start command: the model starts its own dev server via start_dev_server
with a hallucinated `npx expo start --web --port 5173 --no-dev-client` (invalid
flag -> expo exits; hardcoded 5173 -> collides). Normalize any `expo start`
command to the one canonical invocation on the project's allocated port.
3. Corrupted dependency tree: the model rewrites package.json mid-build, pruning
Metro's deps (react-dom, react-native-web, expo-asset) and DOWNGRADING others
(expo-router to a pre-SDK major -> `Font.resetServerContext is not a function`).
Self-heal: re-merge the template's deps with the template's versions winning
for shared packages, keeping app-added extras, and reinstall only on change.
4. SSR-behind-proxy: without web.output:"single" the web dev server renders
per-request and does `new URL(req.url)` behind the preview proxy ->
`TypeError: Invalid URL`. Pin app.json to a metro SPA on every start.
The heal is embedded in the canonical command persisted to the process record,
so it re-applies on restart and wake-from-idle too. Also stop telling the
app-builder agent to "Run Metro" (the preview is managed) to cut redundant
starts. Verified live: fresh mobile builds -> previewRunning:true, no deps
error, no Invalid URL, Metro serving; app HTML renders.1 parent 8adc62e commit e7277e0
3 files changed
Lines changed: 106 additions & 32 deletions
File tree
- apps/agent-worker/src/durable-objects
- packages
- agent-core/src/mastra
- tools-code/src
Lines changed: 32 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
666 | 666 | | |
667 | 667 | | |
668 | 668 | | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
669 | 689 | | |
670 | 690 | | |
671 | 691 | | |
672 | 692 | | |
673 | 693 | | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
678 | | - | |
679 | | - | |
680 | | - | |
681 | | - | |
682 | | - | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
683 | 701 | | |
684 | 702 | | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | 703 | | |
| 704 | + | |
690 | 705 | | |
691 | 706 | | |
692 | 707 | | |
| |||
712 | 727 | | |
713 | 728 | | |
714 | 729 | | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
720 | | - | |
721 | | - | |
722 | | - | |
723 | | - | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
724 | 733 | | |
725 | 734 | | |
726 | | - | |
727 | | - | |
728 | | - | |
729 | | - | |
730 | 735 | | |
| 736 | + | |
731 | 737 | | |
732 | 738 | | |
733 | 739 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | | - | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
222 | 231 | | |
223 | 232 | | |
224 | 233 | | |
| |||
267 | 276 | | |
268 | 277 | | |
269 | 278 | | |
270 | | - | |
| 279 | + | |
271 | 280 | | |
272 | 281 | | |
273 | | - | |
| 282 | + | |
274 | 283 | | |
275 | 284 | | |
276 | 285 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
61 | 70 | | |
62 | | - | |
| 71 | + | |
63 | 72 | | |
64 | 73 | | |
65 | | - | |
| 74 | + | |
66 | 75 | | |
67 | 76 | | |
68 | 77 | | |
| |||
89 | 98 | | |
90 | 99 | | |
91 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
92 | 151 | | |
93 | 152 | | |
94 | 153 | | |
| |||
0 commit comments