tscircuit / tscircuit/cli

CLI crashes at startup with TypeScript 7: @rollup/plugin-typescript reads undefined ModuleKind.ES2015

Open
#4,706 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
18
Forks
91
Avg merge
31m
Merged PRs (30d)
349

Description

Problem

With TypeScript 7.0.2 installed in the project, tsci build crashes before processing even a one-resistor board. Pinning only TypeScript to 5.9.3 allows the same command and source to build.

Reproduction

Linux x64, Bun 1.4.2. In an empty directory:

bun init -y
bun add --exact @tscircuit/cli@0.1.2057 tscircuit@0.0.2516 typescript@7.0.2

index.tsx:

export default () => <board width={10} height={10}><resistor name="R1" resistance="1k" footprint="0603" /></board>

tsconfig.json:

{"compilerOptions":{"jsx":"react-jsx","moduleResolution":"Bundler","module":"ESNext","target":"ESNext","skipLibCheck":true}}
bunx tsci build index.tsx

Exit code: 1. Relevant output:

527 | const validModules = [
528 |     ModuleKind.ES2015,
          ^
TypeError: undefined is not an object (evaluating 'ModuleKind.ES2015')
      at node_modules/@rollup/plugin-typescript/dist/es/index.js:528:5

The resolved Rollup plugin version was @rollup/plugin-typescript@12.3.0.

Control / workaround

bun add --exact typescript@5.9.3
bunx tsci build index.tsx

Verified exit code 0, circuit JSON generated, same source and CLI version.

Expected

Either support the installed TypeScript version or constrain/isolate the compiler dependency and provide an actionable compatibility message. A startup crash inside an eagerly loaded Rollup plugin makes the entire build command unusable. This report concerns the CLI integration/dependency boundary; it does not assume the underlying Rollup plugin already supports TypeScript 7.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the provided Bun commands, index.tsx, tsconfig.json, and tsci build entry point; inspect the CLI's dependency boundary around @rollup/plugin-typescript and the reported dist/es/index.js access to ModuleKind. Done means the TypeScript 7 setup no longer crashes at startup, either by supporting it or by producing an actionable compatibility message, while the TypeScript 5.9.3 control remains successful.

Written by the indexing model from the issue text.

Assessment

Tech stack
bun, rollup, typescript
Domain
build-system, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.