Skip to content

build: bundled OpenTUI chunk is empty, step fails with createLocalTuiClientApp not exported #25

Description

@li-xiu-qi

Bug description

After running the installer (bash scripts/setup.sh), the step command fails immediately with:

step-cli error: OpenTUI runtime did not export createLocalTuiClientApp()

Environment

  • step-realtime-cli version: 1.0.0
  • Node version: v22.14.0
  • OS: Linux (Ubuntu / WSL)
  • Package manager: pnpm 10.17.0

Reproduction steps

  1. git clone https://github.com/stepfun-ai/Step-Realtime-CLI.git
  2. cd Step-Realtime-CLI
  3. bash scripts/setup.sh
  4. Open a new shell (so ~/.step-cli/bin is on PATH)
  5. step

Expected behavior

The interactive TUI starts.

Actual behavior

The process exits immediately with:

step-cli error: OpenTUI runtime did not export createLocalTuiClientApp()

Root cause analysis

The bundle produced by tsdown / rolldown 1.0.0-beta.7 splits src/runtime/local-tui-app.ts into a dynamic chunk (dist/local-tui-app-<hash>.js). However, that chunk is effectively empty (only 3 lines of imports) and does not contain the createLocalTuiClientApp export or the LocalStepCliTuiApp class.

grep shows the symbol is referenced in dist/index.js but never defined in any built chunk:

$ grep -rl 'createLocalTuiClientApp' dist/
dist/index.js
dist/index.cjs

$ cat dist/local-tui-app-dRVjt31N.js
import "./local-session-target-DAN8-Cwd.js";
import "./local-tui-bootstrap-xGRRjkP0.js";
import process from "node:process";

The LocalStepCliTuiApp class is missing from the chunk entirely, so the runtime guard

if (typeof runtimeModule.createLocalTuiClientApp !== 'function') {
  throw new Error('OpenTUI runtime did not export createLocalTuiClientApp()');
}

fails at runtime.

Workaround

Running the entrypoint directly via tsx bypasses the bundled artifacts and starts the TUI correctly:

rm -rf dist
node bin/step-cli.js
# → falls back to: running src/index.ts via tsx

Impact

This breaks the default installation path for any user whose launcher resolves to the bundled dist/index.js.

Related files

  • src/runtime/local-tui-app.ts
  • src/runtime/open-tui-capability.ts
  • tsdown.config.ts

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