Repository navigation
@rollup/plugin-typescript - Support for TypeScript 7 #2016
Description
Activity
C:\Users\kyleh\PP_FILE_STORE\packz_ai_assistant>npm run build > packz-ai-assistant-cloudflow@0.0.1 build > rollup -c [!] TypeError: Cannot read properties of undefined (reading 'ES2015')
I can no longer build my code because of
@rollup/plugin-typescriptnot supporting"typescript": "^7.0.2". Forcing me to stay on TS6- added a commit that references this issue
on Jul 26, 2026 I reproduced the failure with
@rollup/plugin-typescript@12.3.0andtypescript@7.0.2:TypeError: Cannot read properties of undefined (reading "ES2015")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.emit
The missing programmatic emit functionality is being tracked upstream:
- Add ability to get emit output from the API microsoft/TypeScript#63851
- Add native-preview API for capturing .d.ts emit output microsoft/TypeScript#63843
- API feature roadmap microsoft/TypeScript#63875
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.2- importing
typescriptprovides the TypeScript 6 Compiler API, includingModuleKindandcreateWatchProgram pnpm typecheckpasses using TypeScript 7pnpm buildpasses 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
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:
- 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?
- added a commit that references this issue
on Aug 17, 2026 - added a commit that references this issue
on Sep 30, 2026
@rollup/plugin-typescriptIt 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-sucrasefor speed improvements but I'd love to go back to the native TS version once it's supported by@rollup/plugin-typescriptLast requested in:
@rollup/typescript-pluginmicrosoft/typescript-go#1735