Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Duplicate "Cannot find name" error #1383

Open
Labels
bugSomething isn't working
@guillaumebrunerie

Description

@guillaumebrunerie

I have the following two files:

// f.tsdeclareconstx1:A;declareconstx2:A;declareconstx3:A;declareconstx4:A;declareconstx5:A;declareconstx6:A;declareconstx7:A;declareconstx8:A;declareconstx9:A;declareconstx10:A;exportconstf=(k:KeyframeOLD)=>{};// index.tsimport{f}from"./f";f(0);

The filef.ts has errors of the formCannot find name 'A'. (TS2304) on all the lines at the beginning, and thenCannot find name 'KeyframeOLD'. (TS2304) on the last line. So far so good.
A first interesting thing (with Strada) is that if you comment out one of the first lines, then the error on the last line changes toCannot find name 'KeyframeOLD'. Did you mean 'Keyframe'? (TS2552). I guess this is on purpose? There is probably some logic of the form "if there are too many things that not found, give up on suggesting possible typos".

The issue with Corsa is that we actually get both errors at the same time:

> npx tsgo index.ts[...]f.ts:10:20 - error TS2304: Cannot find name 'A'.10 declare const x10: A;                      ~f.ts:12:22 - error TS2304: Cannot find name 'KeyframeOLD'.12 export const f = (k: KeyframeOLD) => {};                        ~~~~~~~~~~~f.ts:12:22 - error TS2552: Cannot find name 'KeyframeOLD'. Did you mean 'Keyframe'?12 export const f = (k: KeyframeOLD) => {};                        ~~~~~~~~~~~Found 12 errors in the same file, starting at: f.ts:1

Strada has only one:

> npx tsc index.ts[...]f.ts:10:20 - error TS2304: Cannot find name 'A'.10 declare const x10: A;                      ~f.ts:12:22 - error TS2304: Cannot find name 'KeyframeOLD'.12 export const f = (k: KeyframeOLD) => {};                        ~~~~~~~~~~~Found 11 errors in the same file, starting at: f.ts:1

I noticed that by running both Corsa and Strada in the middle of a large refactoring to check if we get the same errors, and that was the only difference I noticed so far. Not a very big issue, but still probably a bug to get two very similar errors for the same identifier.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp