Steps to reproduce:
npm install -g @angular/cling new democd demo & code .app.component.html. you will get No config file for app.component.html error in output window:[Info - 17:56:40] Using typescript v3.5.3 from e:\demo\demo\node_modules\typescript
[Info - 17:56:40] Using @angular/language-service v9.0.0-rc.0 from c:\Users\Andrius\.vscode\extensions\angular.ng-template-0.900.0-rc.0\server\node_modules\@angular\language-service
[Info - 17:56:40] Log file: c:\Users\Andrius\AppData\Roaming\Code\logs\20191110T175635\exthost1\Angular.ng-template\nglangsvc.log
[Error - 17:56:44] No config file for e:\demo\demo\src\app\app.component.html
app.component.tsThe Angular Language Service server crashed 5 times in the last 3 minutes. The server will not be restarted. popup and this error in output window.e:\demo\demo\node_modules\typescript\lib\tsserverlibrary.js:122228
throw new Error("Could not find sourceFile: '" + fileName + "' in " + (program && JSON.stringify(program.getSourceFiles().map(function (f) { return f.fileName; }))) + ".");
^
Error: Could not find sourceFile: 'e:/demo/demo/src/app/app.component.html' in
at getValidSourceFile (e:\demo\demo\node_modules\typescript\lib\tsserverlibrary.js:122228:23)
at Object.getSemanticDiagnostics (e:\demo\demo\node_modules\typescript\lib\tsserverlibrary.js:122430:36)
at Object.proxy.getSemanticDiagnostics (e:\demo\demo\node_modules\@angular\language-service\bundles\language-service.umd.js:49429:32)
at Session.sendPendingDiagnostics (c:\Users\Andrius\.vscode\extensions\angular.ng-template-0.900.0-rc.0\server\index.js:792:39)
at Timeout._onTimeout (c:\Users\Andrius\.vscode\extensions\angular.ng-template-0.900.0-rc.0\server\index.js:772:19)
at listOnTimeout (internal/timers.js:531:17)
at processTimers (internal/timers.js:475:7)

Looking at the logs, I think this is due to https://github.com/microsoft/TypeScript/issues/34616
Even though we resolved the location of @angular/language-service and asked tsserver to load the plugin from that location, tsserver would look in typescript's peer node_modules before using the path we provide. If it finds one, it'd use that over the one we passed in.
I deduce this based on the line language-service.umd.js:49429
This must be using an older version of the language service that does not support angularOnly config.
@andrius-pra, could you please manually inspect the version in e:\demo\demo\node_modules\@angular\language-service\package.json?
Another way to confirm this:
The console says:
Using @angular/language-service v9.0.0-rc.0 from c:\Users\Andrius\.vscode\extensions\angular.ng-template-0.900.0-rc.0\server\node_modules\@angular\language-service
but the stack trace shows a different location.
at Object.proxy.getSemanticDiagnostics (e:\demo\demo\node_modules\@angular\language-service\bundles\language-service.umd.js:49429:32)
Maybe the solution here is to invert the default? We load TS and Angular from the bundled location, but provide users with an option load from workspace.
This means we could avoid nasty surprises like this (and the no config found for HTML bug), but it could introduce inconsistency between user's workspace version vs the bundled version.
I think we should leave probing the workspace version as being the default.
@andrius-pra, could you please manually inspect the version in
e:\demo\demo\node_modules\@angular\language-service\package.json?
Angular CLI: 8.3.18
Node: 12.13.0
OS: win32 x64
Angular: 8.2.13
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.803.18
@angular-devkit/build-angular 0.803.18
@angular-devkit/build-optimizer 0.803.18
@angular-devkit/build-webpack 0.803.18
@angular-devkit/core 8.3.18
@angular-devkit/schematics 8.3.18
@angular/cli 8.3.18
@ngtools/webpack 8.3.18
@schematics/angular 8.3.18
@schematics/update 0.803.18
rxjs 6.4.0
typescript 3.5.3
webpack 4.39.2
yeah, it's v8.2.13. I guess we'll have to wait for TypeScript to release the change I made. Does anyone know if they're gonna backport the commit to older versions?
typescript 3.7.2 is already released and it contains your change.
It looks like the change is not yet in ts 3.7.2
I checked the tag in the commit, there's none.
I also inspected the source code (warning: large file!), and searched for peer node_modules, it's still the old behavior.
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._
Most helpful comment
typescript 3.7.2 is already released and it contains your change.