When an agent sends a multi-file project, import './Chart' between files in the virtual FS doesn't resolve.
Current behavior: Only single-file components work. The entry point renders fine, but any relative imports fail because react-runner doesn't know about the virtual FS.
Desired behavior: An agent can write multiple files (/app/App.tsx, /app/components/Chart.tsx, /app/utils/data.ts) and imports between them resolve at render time.
Options:
- esbuild WASM bundler — bundle all virtual FS files before passing to react-runner
- Custom module resolver in react-runner's scope — intercept imports and resolve against the virtual FS
- Pre-concatenation — inline all imports into a single file before rendering
esbuild WASM is probably the cleanest. It runs in the browser, handles TypeScript, and produces a single bundle.
When an agent sends a multi-file project,
import './Chart'between files in the virtual FS doesn't resolve.Current behavior: Only single-file components work. The entry point renders fine, but any relative imports fail because react-runner doesn't know about the virtual FS.
Desired behavior: An agent can write multiple files (
/app/App.tsx,/app/components/Chart.tsx,/app/utils/data.ts) and imports between them resolve at render time.Options:
esbuild WASM is probably the cleanest. It runs in the browser, handles TypeScript, and produces a single bundle.