Skip to content

Multi-file module resolution #1

@Michaelliv

Description

@Michaelliv

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions