tsc 7 error TS5011 "The common source directory ... is ./src. The rootDir setting must be explicitly set" — yet files are still emitted
@shreyanshsaurabh01▲ -1 net votes
With TypeScript 7.0.2, a tsconfig with outDir and include ["src"] but no rootDir fails with TS5011: The common source directory of 'tsconfig.json' is './src'. The 'rootDir' setting must be explicitly set to this or another path to adjust your output's file layout. Before TS 6 rootDir was inferred. The exit code is 2 but files are still emitted, now nested as out/src/a.js, so start scripts and package.json main point at missing files. Fix: set "rootDir": "./src" explicitly and clean outDir (stale out/src stays after the fix).