Skip to content

Debug Failure. False expression: Expected isNewFile for (only) new files #27867

Closed

Description

@amcasey

We have occurrences from 3.0.0-dev to 3.2.0-dev. Here's a stack from 3.1.3:

Error processing request. Debug Failure. False expression: Expected isNewFile for (only) new files
Verbose Debug Information: {"isNewFile":false,"hasScriptInfo":false}
Error: Debug Failure. False expression: Expected isNewFile for (only) new files
Verbose Debug Information: {"isNewFile":false,"hasScriptInfo":false}
    at mapTextChangesToCodeEdits (tsserver.js:123151:22)
    at IOSession.Session.mapTextChangeToCodeEdit (tsserver.js:122984:24)
    at tsserver.js:122981:73
    at Array.map (<anonymous>)
    at IOSession.Session.mapTextChangesToCodeEdits (tsserver.js:122981:36)
    at IOSession.Session.mapCodeFixAction (tsserver.js:122977:84)
    at tsserver.js:122930:96
    at Array.map (<anonymous>)
    at IOSession.Session.getCodeFixes (tsserver.js:122930:55)
    at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (tsserver.js:121789:61)
    at tsserver.js:123086:88
    at IOSession.Session.executeWithRequestId (tsserver.js:123077:28)
    at IOSession.Session.executeCommand (tsserver.js:123086:33)
    at IOSession.Session.onMessage (tsserver.js:123106:35)
    at Interface.<anonymous> (tsserver.js:124369:27)
    at emitOne (events.js:116:13)
    at Interface.emit (events.js:211:7)
    at Interface._onLine (readline.js:282:10)
    at Interface._normalWrite (readline.js:424:12)
    at Socket.ondata (readline.js:141:10)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at Pipe.onread (net.js:594:20)

Activity

  1. amcasey commented on Oct 12, 2018

    @amcasey
    MemberAuthor

    Quite possibly - I've been looking at several. Let me confirm.

  2. amcasey commented on Oct 12, 2018

    @amcasey
    MemberAuthor

    Fixed - sorry about that.

  3. Hexcles commented on Oct 17, 2018

    @Hexcles

    I'm seeing this error from tsserver in my editor (Vim with YCM) (with almost the same stacktrace) when I have import fs = require('fs'); style import in my Node project (target=es2017, everything else is the default). Switching to const fs = require('fs') makes the error go away.

  4. Hexcles commented on Oct 17, 2018

    @Hexcles

    I just found out it only happened when I used import = require style import on a module without type annotations, but this still looks like a bug -- it shouldn't crash the server. tsc is still able to tell me to try npm install @types/..., among other errors.

  5. 6 remaining items

  6. tim-phillips commented on Dec 27, 2018

    @tim-phillips

    I installed Visual Studio Code and it somehow fixed this issue for me in vim/ycm.

  7. sheetalkamat commented on Jan 3, 2019

    @sheetalkamat
    Member

    Closing this as it seems fixed in recent build. Andrew Casey (@amcasey) please reopen if this repros in newer builds.

  8. amcasey commented on Jan 22, 2019

    @amcasey
    MemberAuthor

    I see recent hits for getEditsForFileRename, getEditsForRefactor, and getCodeFixes in 3.3.0-dev, 3.3.0-dev.20190101, and 3.3.0-dev.20190108.

  9. sheetalkamat commented on Jan 22, 2019

    @sheetalkamat
    Member

    Andrew Casey (@amcasey) I think #26280 should also fix it. So if any reports of this after 3.3.0-dev.20190109 would qualify for reinvestigation.

  10. adammenges commented on Feb 10, 2019

    @adammenges

    I currently see this in Atom with atom-typescript:

    screen shot 2019-02-09 at 5 02 20 pm

    ⇒  tsc --version
    Version 3.3.3
  11. sheetalkamat commented on Feb 11, 2019

    @sheetalkamat
    Member

    Adam Menges (@adammenges) Can you please share the tssever log of the issue? Thanks.

  12. sheetalkamat commented on Mar 6, 2019

    @sheetalkamat
    Member

    Adam Menges (@adammenges) Please provide complete tsserver log for us to be able to investigate this futher. Thanks. We will open this again when we have more information. Thanks

  13. locked as resolved and limited conversation to collaborators on Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issueSource: TelemetryThe issue relates to the telemetry in editors

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions