Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getModifiedTime can receive undefined as path value, resulting in a TypeError and crash #14

Open
Arnagos opened this issue Dec 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Arnagos
Copy link

Arnagos commented Dec 10, 2024

Current behavior

Sometimes, TS can call getModifiedTime with an undefined path, resulting in TypeError: Cannot read properties of undefined (reading 'includes').

Stack trace:

TypeError: Cannot read properties of undefined (reading 'includes')
    at (internal project path)\node_modules\ts-checker-rspack-plugin\lib\typescript\worker\lib\system.js:197:48
    at Array.some (<anonymous>)
    at isArtifact ((internal project path)\node_modules\ts-checker-rspack-plugin\lib\typescript\worker\lib\system.js:197:29)
    at getReadFileSystem ((internal project path)\node_modules\ts-checker-rspack-plugin\lib\typescript\worker\lib\system.js:202:66)
    at Object.getModifiedTime ((internal project path)\node_modules\ts-checker-rspack-plugin\lib\typescript\worker\lib\system.js:68:23)
    at Object.getModifiedTime ((internal project path)\node_modules\ts-checker-rspack-plugin\lib\typescript\worker\lib\host\watch-solution-builder-host.js:33:36)
    at getModifiedTime ((internal project path)\node_modules\typescript\lib\typescript.js:7922:15)
    at getUpToDateStatusWorker ((internal project path)\node_modules\typescript\lib\typescript.js:133632:102)
    at getUpToDateStatus ((internal project path)\node_modules\typescript\lib\typescript.js:133841:18)
    at getNextInvalidatedProjectCreateInfo ((internal project path)\node_modules\typescript\lib\typescript.js:133423:20)

Expected behavior

The plugin should catch undefined paths and not crash.

Steps to reproduce the issue

Call getModifiedTime with undefined.

Environment

  • ts-checker-rspack-plugin: 1.0.3
  • typescript: 5.6.3
  • @rspack/core: 1.1.9
  • os: Windows 11
@Arnagos Arnagos added the bug Something isn't working label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant