Skip to content

Error: Could not find file "events.js" in getValidSourceFile during getApplicableRefactors #20785

Closed

Description

@aozgaa

tsserver version: 2.6.1
Hits: 129436

Error: Could not find file: 'c:/.../src/events.js'.
    at getValidSourceFile (tsserver.js:79635:23)
    at Object.getApplicableRefactors (tsserver.js:80231:24)
    at IOSession.Session.getApplicableRefactors (tsserver.js:86474:53)
    at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (tsserver.js:85436:61)
    at tsserver.js:86669:88
    at IOSession.Session.executeWithRequestId (tsserver.js:86660:28)
    at IOSession.Session.executeCommand (tsserver.js:86669:33)
    at IOSession.Session.onMessage (tsserver.js:86689:35)
    at Interface.<anonymous> (tsserver.js:87881:27)
    at emitOne (events.js:96:13)
    at Interface.emit (events.js:191:7)
    at Interface._onLine (readline.js:241:10)
    at Interface._normalWrite (readline.js:384:12)
    at Socket.ondata (readline.js:101:10)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:191:7)
    at readableAddChunk (_stream_readable.js:178:18)
    at Socket.Readable.push (_stream_readable.js:136:10)
    at Pipe.onread (net.js:560:20)

Activity

  1. mhegazy commented on Jan 20, 2018

    @mhegazy
    Contributor

    The Source: Telemetry have limited information. we only have the call stack from the crash report. We need to either mitigate the crash, or add additional asserts to get more information in future crash reports.

  2. mhegazy commented on Feb 8, 2018

    @mhegazy
    Contributor

    VSCode.

  3. mjbvz commented on Mar 13, 2018

    @mjbvz
    Contributor

    Andy (Andrewkraft) (@Andy-MS) Perhaps. Is this only seen for getApplicableRefactors though? Our refactor provider calculates paths the same way as our other providers. Do you have repo steps for this issue?

  4. modified the milestones: TypeScript 2.8.1, on Mar 19, 2018
  5. modified the milestones: , TypeScript 2.9 on Mar 28, 2018
  6. mhegazy commented on Jul 2, 2018

    @mhegazy
    Contributor

    Closing for now.

  7. nsmparsons commented on Jan 3, 2019

    @nsmparsons

    I'm running into this error pretty consistently when using the Tide Plugin for Emacs.
    TypeScript/ Tsserver Version: 3.2.1

    Error: Could not find file: '/home/mparsons/Work/develop/admin-frontend/assets/js/src/app/apps/Signage/resources/Schedule/components/form-handler.component.ts'.
    at getValidSourceFile (/home/mparsons/Work/develop/admin-frontend/node_modules/typescript/lib/tsserver.js:117219:23)
    at Object.getSyntacticDiagnostics (/home/mparsons/Work/develop/admin-frontend/node_modules/typescript/lib/tsserver.js:117412:52)
    at /home/mparsons/Work/develop/admin-frontend/node_modules/typescript/lib/tsserver.js:124988:126
    at IOSession.Session.getDiagnosticsWorker (/home/mparsons/Work/develop/admin-frontend/node_modules/typescript/lib/tsserver.js:124846:35)
    at IOSession.Session.getSyntacticDiagnosticsSync (/home/mparsons/Work/develop/admin-frontend/node_modules/typescript/lib/tsserver.js:124988:29)
    at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (/home/mparsons/Work/develop/admin-frontend/node_modules/typescript/lib/tsserver.js:124389:61)
    at /home/mparsons/Work/develop/admin-frontend/node_modules/typescript/lib/tsserver.js:125836:88
    at IOSession.Session.executeWithRequestId (/home/mparsons/Work/develop/admin-frontend/node_modules/typescript/lib/tsserver.js:125827:28)
    at IOSession.Session.executeCommand (/home/mparsons/Work/develop/admin-frontend/node_modules/typescript/lib/tsserver.js:125836:33)
    at IOSession.Session.onMessage (/home/mparsons/Work/develop/admin-frontend/node_modules/typescript/lib/tsserver.js:125858:35)
    at Interface. (/home/mparsons/Work/develop/admin-frontend/node_modules/typescript/lib/tsserver.js:127118:27)
    at emitOne (events.js:116:13)
    at Interface.emit (events.js:211:7)
    at Interface._onLine (readline.js:280:10)
    at Interface._normalWrite (readline.js:422:12)
    at Socket.ondata (readline.js:139: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:597:20)

    File exists and the path is valid:
    $ ls /home/mparsons/Work/develop/admin-frontend/assets/js/src/app/apps/Signage/resources/Schedule/components/form-handler.component.ts
    /home/mparsons/Work/develop/admin-frontend/assets/js/src/app/apps/Signage/resources/Schedule/components/form-handler.component.ts

  8. ChoppinBlockParty commented on Jan 4, 2019

    @ChoppinBlockParty

    The same here.

  9. mattn commented on Jan 21, 2020

    @mattn

    I found a bug that link of issues are endless-loop. So this issue is not fixed.

  10. 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

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptSource: 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