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] Dev server broken by "File extension for signature expected to be dts" #4224

Closed
octogonz opened this issue Jul 5, 2023 · 2 comments · Fixed by #4471
Closed

[heft] Dev server broken by "File extension for signature expected to be dts" #4224

octogonz opened this issue Jul 5, 2023 · 2 comments · Fixed by #4471
Assignees
Labels
bug Something isn't working as intended

Comments

@octogonz
Copy link
Collaborator

octogonz commented Jul 5, 2023

Summary

After upgrading to the latest Heft+TypeScript, I now occasionally get this error in the heft start dev server:

[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/my-app/lib/ui/misc/App.d.ts.map

After this error is reported, the dev server will continue serving the old build. So you can spend several minutes debugging a "problem" that ultimately turns out be that you're debugging an outdated build.

Killing and restarting heft start fixes the problem.

Repro steps

I haven't been able to determiner repro steps yet.

@iclanton said he encountered the same issue recently.

Details

This error message is an assertion failure in the typescript package:

typescript/src/compiler/builderState.ts

    export function computeDtsSignature(
        programOfThisState: Program,
        sourceFile: SourceFile,
        cancellationToken: CancellationToken | undefined,
        host: HostForComputeHash,
        onNewSignature: (signature: string, sourceFiles: readonly SourceFile[]) => void,
    ) {
        programOfThisState.emit(
            sourceFile,
            (fileName, text, _writeByteOrderMark, _onError, sourceFiles, data) => {
                Debug.assert(isDeclarationFileName(fileName), `File extension for signature expected to be dts: Got:: ${fileName}`);
                onNewSignature(computeSignatureWithDiagnostics(

So it seems that heft-typescript-plugin is sometimes passing an incorrect file extension to the compiler. (?)

Why does the Heft dev server never recover however? In addition to fixing the root cause, maybe we could also make Heft's dev server more robust.

Standard questions

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

Question Answer
@rushstack/heft version? 0.55.2
typescript version? 5.0.4
Operating system? Windows
Node.js version (node -v)? v16.15.1
@octogonz octogonz changed the title [heft] [heft] Dev server broken by "File extension for signature expected to be dts" Jul 5, 2023
@octogonz octogonz added the bug Something isn't working as intended label Jul 5, 2023
@Faithfinder
Copy link
Contributor

I also don't have a repro, but it happened to me fairly consistently. I also don't think it's heft 51 related, as the branch I've experienced it on is on 0.50.5.

(Might have happened for a while, as we don't often use heft watch mode, and use rush's watchForChanges from command-line.json instead)

@iclanton iclanton moved this to Needs Investigation in Bug Triage Aug 15, 2023
@github-project-automation github-project-automation bot moved this from Needs Investigation to Closed in Bug Triage Jan 2, 2024
@octogonz
Copy link
Collaborator Author

octogonz commented Jan 3, 2024

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

@Faithfinder

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.

3 participants