fix: run Nitro in-process in Start WebContainers - #1279
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughThe async-context WebContainer setup now selects Nitro’s ChangesWebContainer Nitro runner
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The change is narrowly scoped to Nitro runner configuration, with no established merge-blocking risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
After the Rolldown WASI load and the standalone example tsconfig, Vite starts. The first request then fails with
Vite environment "nitro" is unavailable.Nitro's default runner is
node-worker. In WebContainer that worker never finishes loading the nitro entry. This PR runs Nitro in-process (self) for the Start sandbox profile only. Query, Table, Charts, and other esbuild sandboxes stay unchanged.Testing
Commands run:
vite --config .tanstack/vite.config.mjs) returned HTTP 200 locally.NITRO_DEV_RUNNER=selfreturned HTTP 200.pnpm exec tsx --test tests/example-webcontainer-start.test.tspassed.pnpm run test: 525 passed, 3 skipped.Manual test after deploy:
Vite environment "nitro" is unavailableerror.Risk / rollback
Start docs sandboxes get the same in-process Nitro runner. Revert this PR to restore
node-worker.Summary by CodeRabbit
Bug Fixes
Tests