You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
@rollup/plugin-typescript - Support for TypeScript 7 #2016
It seems that the plugin hasn't seen any updates since 2025, it would be great to see support for TypeScript 7 (keywords: tsgo, ts7) since it finally launched:
I've been using @rollup/plugin-sucrase for speed improvements but I'd love to go back to the native TS version once it's supported by @rollup/plugin-typescript
I reproduced the failure with @rollup/plugin-typescript@12.3.0 and typescript@7.0.2:
TypeError: Cannot read properties of undefined (reading "ES2015")
The immediate cause is that TypeScript 7 exposes only version metadata from the typescript package root, while the plugin eagerly imports that package and reads ModuleKind at module scope.
Changing the import to typescript/unstable/sync would not provide full compatibility. The new API exposes ModuleKind, but it does not expose several legacy APIs currently used by the plugin, including:
createWatchProgram
createWatchCompilerHost
createEmitAndSemanticDiagnosticsBuilderProgram
parseJsonConfigFileContent
sys
program.emit
The missing programmatic emit functionality is being tracked upstream:
importing typescript provides the TypeScript 6 Compiler API, including ModuleKind and createWatchProgram
pnpm typecheck passes using TypeScript 7
pnpm build passes using the TypeScript 6 Compiler API through @rollup/plugin-typescript
This is a working migration path, but it is not native TypeScript 7 support.
There also appears to be a related issue with the documented custom typescript option from microsoft/typescript-go#2012: eager imports of the default typescript package prevent that option from cleanly selecting @typescript/typescript6 when typescript@7 is installed under its normal package name.
Would the maintainers accept a short-term PR that:
detects TypeScript 7 and reports an actionable compatibility error;
documents and tests the official side-by-side setup;
consistently uses the supplied compiler instance where possible;
tracks full native support separately until the TypeScript 7 emit APIs are available?
Activity
Khoeckman commentedon Jul 20, 2026
I can no longer build my code because of
@rollup/plugin-typescriptnot supporting"typescript": "^7.0.2". Forcing me to stay on TS6build(deps): stop proposing TypeScript majors, and say when to stop i…
lwmacct commentedon Aug 5, 2026
I reproduced the failure with
@rollup/plugin-typescript@12.3.0andtypescript@7.0.2:The immediate cause is that TypeScript 7 exposes only version metadata from the
typescriptpackage root, while the plugin eagerly imports that package and readsModuleKindat module scope.Changing the import to
typescript/unstable/syncwould not provide full compatibility. The new API exposesModuleKind, but it does not expose several legacy APIs currently used by the plugin, including:createWatchProgramcreateWatchCompilerHostcreateEmitAndSemanticDiagnosticsBuilderProgramparseJsonConfigFileContentsysprogram.emitThe missing programmatic emit functionality is being tracked upstream:
I also tested the official TypeScript 7 and TypeScript 6 side-by-side dependency layout in a real Rollup project:
{ "devDependencies": { "@typescript/native": "npm:typescript@^7.0.2", "typescript": "npm:@typescript/typescript6@^6.0.2" } }The verification results were:
pnpm exec tsc --versionreports7.0.2typescriptprovides the TypeScript 6 Compiler API, includingModuleKindandcreateWatchProgrampnpm typecheckpasses using TypeScript 7pnpm buildpasses using the TypeScript 6 Compiler API through@rollup/plugin-typescriptThis is a working migration path, but it is not native TypeScript 7 support.
There also appears to be a related issue with the documented custom
typescriptoption from microsoft/typescript-go#2012: eager imports of the defaulttypescriptpackage prevent that option from cleanly selecting@typescript/typescript6whentypescript@7is installed under its normal package name.Would the maintainers accept a short-term PR that:
ci: Narrow the TypeScript hold to 7.x
chore(deps): update dependency typescript to v6