Microsoft/TypeScript

Computing buildInfoTime even when !isIncremental

Open

#60,500 建立於 2024年11月14日

在 GitHub 查看
 (3 留言) (1 反應) (0 負責人)TypeScript (48,455 star) (6,726 fork)batch import
Domain: tsc: --incrementalHelp WantedPossible Improvement

描述

@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

貢獻者指南