Skip to content

JavaScript Build fails on chore/typescript-7 (PR #106): TS 7's native compiler breaks Rollup and ESLint typed-linting #254

Description

@cratis-direct

Describe the bug

The JavaScript Build workflow fails on PR #106 (chore/typescript-7, #106), most recently in run https://github.com/Cratis/Components/actions/runs/34227857632. main itself is green (typescript stays pinned at ^6.0.3 there) — this is isolated to the TypeScript 7 upgrade attempt.

Steps to reproduce

  1. Check out chore/typescript-7 (or bump root package.json's typescript to ^7.0.2).
  2. yarn install
  3. yarn build (which runs rollup -c ./rollup.config.mjs via @rollup/plugin-typescript)

Expected behavior

The Rollup build (and yarn lint) succeed against TypeScript 7, or CI clearly documents that the toolchain isn't ready yet.

Actual behavior

Rollup crashes:

[!] TypeError: Cannot read properties of undefined (reading 'ES2015')
    at node_modules/@rollup/plugin-typescript/dist/es/index.js:528:16

yarn install also emits, before the crash:

YN0060: typescript is listed by your project with version 7.0.2, which doesn't satisfy what
@typescript-eslint/eslint-plugin and other dependencies request (>=4.9.0 <6.1.0).

Root cause (confirmed independently)

TypeScript 7 ships a native (Go) compiler. Its typescript npm package only exports version / versionMajorMinor — the classic JS compiler API (ModuleKind, ScriptTarget, createProgram, …) is gone. Any tool that drives typescript as a library rather than shelling out to the tsc CLI breaks:

So neither of the two possible fixes is available today:

  • Updating @rollup/plugin-typescript to a version that supports TS7 — no such version exists yet.
  • Keeping @typescript-eslint happy with TS7 — its peer range still excludes it.

The only way to make this repo's toolchain green with typescript on ^7.0.2 right now would be dropping Rollup-based bundling and ESLint typed-linting, which is out of proportion to a version bump.

Recommendation

Keep typescript pinned to ^6.0.3 (as main already is) and leave PR #106 open-but-parked, or close it, until both rollup/plugins#2016 and typescript-eslint/typescript-eslint#10940 land native-compiler support. Re-attempt the upgrade once those are resolved.

Additional context

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingbuildcidependenciesPull requests that update a dependency file

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions