Microsoft/TypeScript

Computing buildInfoTime even when !isIncremental

Open

#60.500 geöffnet am 14. Nov. 2024

Auf GitHub ansehen
 (3 Kommentare) (1 Reaktion) (0 zugewiesene Personen)TypeScript (48.455 Stars) (6.726 Forks)batch import
Domain: tsc: --incrementalHelp WantedPossible Improvement

Beschreibung

@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

Contributor Guide