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

[heft] Certain errors cause the watcher to stop updating, instead serving an outdated build #4470

Closed
octogonz opened this issue Jan 2, 2024 · 1 comment · Fixed by #4471
Labels
bug Something isn't working as intended

Comments

@octogonz
Copy link
Collaborator

octogonz commented Jan 2, 2024

Summary

  1. Invoke heft start to work on a web app
  2. Save a change to a TypeScript file that produces an error
  3. Fix the error

Expected result: Pressing F5 in the web browser reloads the latest build

Actual result: Pressing F5 reloads the old build from step 1. Modifications of source files are entirely ignored.

This situation is extremely frustrating, because you can spend 10 minutes trying to understand why a bug persists no matter how you try to fix it, only to eventually realize that you're debugging an outdated build.

Repro steps

I haven't had time to prepare a step-by-step repro. But usually it is a simple syntax error such as renaming class TheThing { to class The Thing { in a *.tsx file. And the log output will look like this:

---- build started ----
[build:typescript] File change detected. Starting incremental compilation...
[build:typescript] Error: Debug Failure. False expression: File extension for signature expected to be dts: Got:: C:/Git/my-repo/apps/webapp/lib/ExamplePane.d.ts.map
-------------------- Failed (0.219s) --------------------
Encountered 1 error
  [build:typescript] Debug Failure. False expression: File extension for signature expected to be dts: Got:: C:/Git/my-repo/apps/webapp/lib/ExamplePane.d.ts.map
Waiting for changes. Press CTRL + C to exit...

In the above test, I was using a newer compiler:

[build:typescript] The TypeScript compiler version 5.2.2 is newer than the latest version that was tested with Heft (5.0); it may not work correctly.
[build:typescript] Using TypeScript version 5.2.2
[build:typescript] Starting compilation in watch mode...

However I seem to remember this problem occurring with TypeScript 4.x as well. (?) It's not a new phenomenon.

Details

@dmichon-msft believes it is actually a TypeScript compiler bug.

However even if that is the case, in such a situation either:

  • Heft should recover from the crash and automatically relaunch the compiler, - OR -
  • If recovery is impossible, Heft should at least notify the engineer as conspicuously as possible that the watch experience has broken

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
@rushstack/heft version? 0.63.2
Operating system? Windows
Would you consider contributing a PR? Yes
Node.js version (node -v)? v16.20.2
@octogonz octogonz added the bug Something isn't working as intended label Jan 2, 2024
@octogonz
Copy link
Collaborator Author

octogonz commented Jan 3, 2024

🚀 This was fixed in @rushstack/heft-typescript-plugin 0.2.16

@github-project-automation github-project-automation bot moved this to Needs triage in Bug Triage Jan 8, 2024
@iclanton iclanton moved this from Needs triage to Closed in Bug Triage Jan 8, 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 as intended
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant