Webstorm Error:Initialization error (angular 2 language service). undefined is not a function

Opened a project I was previously working in VSCODE and opening in Webstorm always gives me this typescript error

Error:Initialization error (angular 2 language service). undefined is not a function

I think its maybe to do with an VSCODE extension for angular snippets but don't know 100%.

Not sure where to go to fix it either

Comment actions Permalink

Message indicates that angular language service has failed to start. What TypeScript version is chosen in Settings | Languages & Frameworks | TypeScript? What IDE version do you use? What "@angular/language-service" version do you have installed?

Comment actions Permalink

Typescript is set to autodetect and set to version 2.3.4 and angular/language-service is Angular Language Service: 5.0.0-beta.5

I was using Microsoft VS Code but switched to Webstorm to maybe see if I can get some productivity improvements.


Comment actions Permalink

please can you provide your package.json? Also, what Webstorm version do you use?

Comment actions Permalink
//I am using Webstorm 2017.2.5
"name": "hello-world",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
"private": true,
"dependencies": {
"@angular/animations": "^4.2.4",
"@angular/common": "^4.2.4",
"@angular/compiler": "^4.2.4",
"@angular/core": "^4.2.4",
"@angular/forms": "^4.2.4",
"@angular/http": "^4.2.4",
"@angular/platform-browser": "^4.2.4",
"@angular/platform-browser-dynamic": "^4.2.4",
"@angular/router": "^4.2.4",
"bootstrap": "^3.3.7",
"core-js": "^2.4.1",
"rxjs": "^5.4.2",
"zone.js": "^0.8.14"
"devDependencies": {
"@angular/cli": "1.4.4",
"@angular/compiler-cli": "^4.2.4",
"@angular/language-service": "^4.2.4",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "~3.2.0",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~3.2.0",
"tslint": "~5.7.0",
"typescript": "~2.3.3"
Comment actions Permalink

Hmm... I can see @angular/language-service": "^4.2.4". What is Angular Language Service: 5.0.0-beta.5?

Comment actions Permalink

so how is Webstorm detecting different version? How can I change or update Webstorm to get correct version?

Comment actions Permalink

I get Angular Language Service: 5.0.0-beta.5 from the output window in VS Code

Comment actions Permalink

WebStorm is using locally installed package. I have no idea what is Angular Language Service in VS Code - may be, a VS Code language service integration

Comment actions Permalink

I recreated the issue in 2017.2.5 - looks as if the Angular service integration there is not compatible with recent @angular/language-service version. But everything works as expected in 2017.3 EAP (https://confluence.jetbrains.com/display/WI/WebStorm+EAP)

Comment actions Permalink

I see, well I cannot use 2017.3.EAP in day to day uses really because I am not sure what other bugs I may encounter. 
Anyway just to clarify some points.  VS Code is essentially Microsoft version of Webstorm. The angular language service is an extension that is used to give angular snippets and intellisense.

Thank you for your help.

When is 2017.3 expected to go into production?

Comment actions Permalink

It can be expected by the end of November

Comment actions Permalink

Same problem here, plz provide a fix!

Comment actions Permalink

Your issue is different, unless you are using WebStorm 2017.2


Please sign in to leave a comment.