Microsoft/TypeScript

Computing buildInfoTime even when !isIncremental

Open

#60.500 aperta il 14 nov 2024

Vedi su GitHub
 (3 commenti) (1 reazione) (0 assegnatari)TypeScript (6726 fork)batch import
Domain: tsc: --incrementalHelp WantedPossible Improvement

Metriche repository

Star
 (48.455 star)
Metriche merge PR
 (Merge medio 6g 17h) (9 PR mergiate in 30 g)

Descrizione

@sheetalkamat @johnnyreilly I'm out of my depth, but I think there's maybe a bug introduced here.

I'm getting TypeError: Cannot read properties of undefined (reading 'includes') in fork-ts-checker-webpack-plugin when my project is NOT incremental: true.

Prior to this revision buildInfoTime was not computed if buildInfoPath was undefined but after this change, even though buildInfoPath is undefined, it is still attempting to compute ts_getModifiedTime(host, buildInfoPath)

Eventually, this calls to isArtifact(undefined) in fork-ts-checker-webpack-plugin\lib\typescript\worker\lib\system.js

[function isArtifact(path) {

return ((artifacts.dirs.some((dir) => path.includes(dir)) ||
    artifacts.files.some((file) => path === file)) &&
    artifacts.extensions.some((extension) => path.endsWith(extension)));

}](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/blob/0fab463b21c6edc4d94834568a3f440241d57887/src/typescript/worker/lib/system.ts#L284C1-L290C2)

Perhaps this needs to be handled in fork-ts-checker-webpack-plugin? But it seems to me that perhaps buildInfoTime could be skipped when buildInfoPath is unavailable.

Originally posted by @JasonKleban in dca9182

Guida contributor