Skip to content

[plugin] @angular/language-service doesn't work with TypeScript 2.8 and above.  #24865

Closed

Description

@duki994

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:

Current behavior

Currently unusable with TypeScript 2.8+ versions when used as tsserver plugin in tsconfig.json.

I got this error.
microsoft/TypeScript#19000

But I don't think it's TypeScript issue, since it works on TS 2.7.2.

TypeScript log from debug window in VSCode. *must_hide_path*. I had to hide path since it contains some sensitive info from this project (NDA signed).

[Info  - 9:23:21 AM] Started TSServer
[Error  - 9:23:25 AM] 'navtree' request failed with error.
Error processing request. Cannot read property 'getSourceFile' of undefined
TypeError: Cannot read property 'getSourceFile' of undefined
    at tryCall (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\@angular\language-service\bundles\language-service.umd.js:48051:44)
    at Object.getNavigationTree (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\@angular\language-service\bundles\language-service.umd.js:48062:45)
    at Object.proxy.(anonymous function) [as getNavigationTree] (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\@angular\language-service\bundles\language-service.umd.js:48133:50)
    at IOSession.Session.getNavigationTree (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:91851:44)
    at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:90837:61)
    at c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:92167:88
    at IOSession.Session.executeWithRequestId (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:92158:28)
    at IOSession.Session.executeCommand (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:92167:33)
    at IOSession.Session.onMessage (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:92187:35)
    at Interface.<anonymous> (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:93384: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)
[Error  - 9:23:25 AM] 'getOutliningSpans' request failed with error.
Error processing request. Cannot read property 'getSourceFile' of undefined
TypeError: Cannot read property 'getSourceFile' of undefined
    at tryCall (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\@angular\language-service\bundles\language-service.umd.js:48051:44)
    at Object.getOutliningSpans (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\@angular\language-service\bundles\language-service.umd.js:48062:45)
    at Object.proxy.(anonymous function) [as getOutliningSpans] (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\@angular\language-service\bundles\language-service.umd.js:48133:50)
    at IOSession.Session.getOutliningSpans (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:91526:45)
    at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:90703:61)
    at c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:92167:88
    at IOSession.Session.executeWithRequestId (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:92158:28)
    at IOSession.Session.executeCommand (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:92167:33)
    at IOSession.Session.onMessage (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:92187:35)
    at Interface.<anonymous> (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:93384: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)
[Error  - 9:23:25 AM] 'getApplicableRefactors' request failed with error.
Error processing request. Cannot read property 'getMissingFilePaths' of undefined
TypeError: Cannot read property 'getMissingFilePaths' of undefined
    at Object.updateMissingFilePathsWatch (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:86824:40)
    at ConfiguredProject.Project.updateGraphWorker (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:88381:24)
    at ConfiguredProject.Project.updateGraph (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:88320:39)
    at ConfiguredProject.updateGraph (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:88675:61)
    at ConfiguredProject.Project.getLanguageService (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:88036:26)
    at IOSession.Session.getApplicableRefactors (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:91955:32)
    at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:90881:61)
    at c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:92167:88
    at IOSession.Session.executeWithRequestId (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:92158:28)
    at IOSession.Session.executeCommand (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:92167:33)
    at IOSession.Session.onMessage (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:92187:35)
    at Interface.<anonymous> (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:93384: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)
[Error  - 9:23:25 AM] 'getApplicableRefactors' request failed with error.
Error processing request. Cannot read property 'getMissingFilePaths' of undefined
TypeError: Cannot read property 'getMissingFilePaths' of undefined
    at Object.updateMissingFilePathsWatch (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:86824:40)
    at ConfiguredProject.Project.updateGraphWorker (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:88381:24)
    at ConfiguredProject.Project.updateGraph (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:88320:39)
    at ConfiguredProject.updateGraph (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:88675:61)
    at ConfiguredProject.Project.getLanguageService (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:88036:26)
    at IOSession.Session.getApplicableRefactors (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:91955:32)
    at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:90881:61)
    at c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:92167:88
    at IOSession.Session.executeWithRequestId (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:92158:28)
    at IOSession.Session.executeCommand (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:92167:33)
    at IOSession.Session.onMessage (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:92187:35)
    at Interface.<anonymous> (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:93384: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)
[Error  - 9:23:25 AM] 'getApplicableRefactors' request failed with error.
Error processing request. Cannot read property 'getMissingFilePaths' of undefined
TypeError: Cannot read property 'getMissingFilePaths' of undefined
    at Object.updateMissingFilePathsWatch (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:86824:40)
    at ConfiguredProject.Project.updateGraphWorker (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:88381:24)
    at ConfiguredProject.Project.updateGraph (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:88320:39)
    at ConfiguredProject.updateGraph (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:88675:61)
    at ConfiguredProject.Project.getLanguageService (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:88036:26)
    at IOSession.Session.getApplicableRefactors (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:91955:32)
    at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:90881:61)
    at c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:92167:88
    at IOSession.Session.executeWithRequestId (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:92158:28)
    at IOSession.Session.executeCommand (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:92167:33)
    at IOSession.Session.onMessage (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:92187:35)
    at Interface.<anonymous> (c:\Users\dknezevic\Documents\*must_hide_path*\node_modules\typescript\lib\tsserver.js:93384: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)

Expected behavior

To work with TypeScript 2.8+ versions

Minimal reproduction of the problem with instructions

Simply use TypeScript 2.8+ and add @angular/language-service to plugins in tsconfig.json

What is the motivation / use case for changing the behavior?

Environment


Angular version: 6.0.7

no
Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: 8.11.3  
- Platform:  Windows 

Others:

Used VSCode to get debug info from TypeScript since tsserver log is useless in this case

Activity

  1. sarunint commented on Jul 13, 2018

    @sarunint
    Contributor

    Angular v6.0 does not support TypeScript 2.8 yet. Support for TypeScript 2.8/2.9 will land in Angular v6.1.

  2. duki994 commented on Jul 16, 2018

    @duki994
    Author

    @sarunint

    6.1.0-rc.0 just doesn't work with Angular Language service 6.1.0-rc.0 with Typescript 2.8 or 2.9.
    Same error as above.

    And it's stated in changelog that support for TypeScript 2.9 was added.
    I think RC should work as it's Release Candidate, not a beta version.

  3. added this to the needsTriage milestone on Jul 17, 2018
  4. duki994 commented on Jul 26, 2018

    @duki994
    Author

    Still not working on 6.1.0 stable

  5. self-assigned this
    on Sep 5, 2018
  6. miwaniak commented on Oct 25, 2018

    @miwaniak

    Still not working on 7.0.1 stable

  7. mlangwell commented on Nov 30, 2018

    @mlangwell

    Not working after updating to Angular 7.0.2 and Typescript 3.1.6

  8. kyliau commented on Nov 30, 2018

    @kyliau
    Contributor

    This ticket is for the use case when the language service is used as a tsserver plugin.
    (i.e. it is not for the official Angular Language Service extension)
    What's the best way to reproduce this error?

  9. mlangwell commented on Nov 30, 2018

    @mlangwell

    @kyliau all I did was update angular to the latest version with ng update @angular/core. This updated all of our Angular dependencies as well as the Typescript dependency to the versions I listed above. After the update, all of the Language Service intellisense was not working.

  10. removed this from the needsTriage milestone on Dec 5, 2018
  11. added this to the needsTriage milestone on Dec 5, 2018
  12. modified the milestones: needsTriage, Backlog on Dec 6, 2018
  13. duki994 commented on Dec 17, 2018

    @duki994
    Author

    @kyliau

    Language service in VSCode is built around tsservice language service. VSCode extension is just a wrapper for tsserver plugin afaik. I tried modifying dependencies to angular 7 and typescript 3.x and building VSCode extension. It doesn't work. Since it's a problem with language service. Some changes were made in TS 2.8 and above which broke many language services. Not this one only.

  14. kyliau commented on Dec 17, 2018

    @kyliau
    Contributor

    @duki994 The VSCode extension is not (yet) a tsserver plugin. Currently it bundles its own Typescript. Did you try out v0.1.11? It was updated to support Angular v7 and Typescript 3.1
    Please download the latest version here

  15. duki994 commented on Dec 25, 2018

    @duki994
    Author

    @kyliau
    New LS works in VSCode.

  16. vsviridov commented on Mar 13, 2019

    @vsviridov

    Not working with ng-cli@7.2.2 with typescript@3.1.6

  17. changed the title [-]@angular/language-service doesn't work with TypeScript 2.8 and above. [/-] [+][plugin] @angular/language-service doesn't work with TypeScript 2.8 and above. [/+] on May 30, 2019
  18. added
    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
    and removed on Oct 1, 2020
  19. atscott commented on Feb 8, 2022

    @atscott
    Contributor

    Closing as likely obsolete.

  20. angular-automatic-lock-bot commented on Mar 11, 2022

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  21. locked and limited conversation to collaborators on Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: language-serviceIssues related to Angular's VS Code language servicefreq2: mediumtype: bug/fix

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions