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-tpescript] Rollup does not get module and moduleResolution settings from extended tsconfig.json #1726
Settings for module and moduleResolution in compilerOptions in tsconfig.base.json should be also used for tsconfig.lib.json and tsconfig.rollup.json.
Actual Behavior
If I do not specify 'moduleandmoduleResolutionintsconfig.rollup.json` I get the warning
(!) [plugin typescript] @rollup/plugin-typescript TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'.
The same warning appears when I do not specify these settings in the rollup.config.ts in the typescript plugin options or in the file tsconfig.lib.json.
Hey folks. This issue hasn't received any traction for 60 days, so we're going to close this for housekeeping. If this is still an ongoing issue, please do consider contributing a Pull Request to resolve it. Further discussion is always welcome even with the issue closed. If anything actionable is posted in the comments, we'll consider reopening it. ⓘ
Hi — this is still reproducible on master (and @rollup/plugin-typescript@12.3.0) under TypeScript 5.x. The root cause is what #1583 described: parseTypescriptConfig in packages/typescript/src/options/tsconfig.ts spreads DEFAULT_COMPILER_OPTIONS ({ module: 'esnext', skipLibCheck: true }) into the leaf compilerOptions slot passed to ts.parseJsonConfigFileContent, which makes the plugin defaults win over anything inherited via extends. A base config setting module: nodenext / moduleResolution: nodenext ends up with module: esnext on the resolved options while moduleResolution: nodenext survives, and TypeScript reports TS5110.
Approach: stop spreading DEFAULT_COMPILER_OPTIONS into the leaf slot; apply them after parseJsonConfigFileContent returns, only for keys the resolved config (extends chain included) left unset. Defaults are coerced via ts.convertCompilerOptionsFromJson so JSON strings like 'esnext' end up as ts.ModuleKind.ESNext on the parsed options.
Tests: a new extends-nodenext fixture plus a version-independent unit test on parseTypescriptConfig (red on master regardless of bundled TS version) and an end-to-end check that no TS5110 warning fires. Verified green against typescript@4.8.4 (current dev-dep) and typescript@5.9.3.
Activity
sam-mfb commentedon Jul 29, 2024
This looks like it is probably the same as this issue. That reporter provided a detailed explanation of the source.
stale commentedon Apr 27, 2025
Hey folks. This issue hasn't received any traction for 60 days, so we're going to close this for housekeeping. If this is still an ongoing issue, please do consider contributing a Pull Request to resolve it. Further discussion is always welcome even with the issue closed. If anything actionable is posted in the comments, we'll consider reopening it. ⓘ
newswim commentedon May 29, 2026
Hi — this is still reproducible on
master(and@rollup/plugin-typescript@12.3.0) under TypeScript 5.x. The root cause is what #1583 described:parseTypescriptConfiginpackages/typescript/src/options/tsconfig.tsspreadsDEFAULT_COMPILER_OPTIONS({ module: 'esnext', skipLibCheck: true }) into the leafcompilerOptionsslot passed tots.parseJsonConfigFileContent, which makes the plugin defaults win over anything inherited viaextends. A base config settingmodule: nodenext/moduleResolution: nodenextends up withmodule: esnexton the resolved options whilemoduleResolution: nodenextsurvives, and TypeScript reports TS5110.I have a PR for this: #2004.
Approach: stop spreading
DEFAULT_COMPILER_OPTIONSinto the leaf slot; apply them afterparseJsonConfigFileContentreturns, only for keys the resolved config (extends chain included) left unset. Defaults are coerced viats.convertCompilerOptionsFromJsonso JSON strings like'esnext'end up asts.ModuleKind.ESNexton the parsed options.Tests: a new
extends-nodenextfixture plus a version-independent unit test onparseTypescriptConfig(red on master regardless of bundled TS version) and an end-to-end check that no TS5110 warning fires. Verified green againsttypescript@4.8.4(current dev-dep) andtypescript@5.9.3.Happy to iterate on the approach.
fix(typescript): apply plugin defaults after tsconfig parse so extend…
fix(typescript): apply plugin defaults after tsconfig parse so extend…