- Error
- Reported by the tsconfig loader
TS5095
Option '{0}' can only be used when 'module' is set to 'preserve', 'commonjs', or 'es2015' or later.
`moduleResolution` is `bundler` but `module` is an old format. Use `esnext`, `preserve` or `commonjs`.
What it means
"moduleResolution": "bundler" only works with module formats a bundler understands: preserve, commonjs, or es2015 and later. It is reported on the moduleResolution value when module is amd, umd or system. Those formats were also removed in TypeScript 7, so you usually see an error about the removed module value next to it.
ts-r's config loader has this check, but ts-r-check doesn't print program-level option diagnostics yet, so it doesn't report this code today. tsc 7 does.
How to fix
- Set
"module": "esnext"(or"preserve"if a bundler handles the output). - If you really need AMD, UMD or SystemJS output, let your bundler produce it from ES modules.