question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

This component requires inline template type-checking, which is not supported by the current environment.(-998900)

See original GitHub issue

🐞 bug report

Affected Package

The issue is caused by package @angular/compiler-cli

Is this a regression?

Yes, the previous version in which this bug was not present was: yes, this error is only shown when I enable preview ivy language service.

Description

Angular LS gives me an error, but it doesn’t say me what happens or how I can fix it. I have located that error message being produced from here https://github.com/angular/angular/blob/master/packages/compiler-cli/src/ngtsc/typecheck/src/oob.ts#L155-L159

By what I can test it, Angular doesn’t like that my component has a generic which extends.

πŸ”¬ Minimal Reproduction

@Component({
  selector: 'test-app',
  template: ``,
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class Testcomponent<Model extends Object> {}

image image

This doesn’t produce that message error:

@Component({
  selector: 'test-app',
  template: ``,
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class Testcomponent<Model> {}

If component has a templateUrl, the error is shown there too… but without no sense the location image

πŸ”₯ Exception or Error

this is the Angular Language Service error:

This component requires inline template type-checking, which is not supported by the current environment.(-998900)

🌍 Your Environment

Angular Version:




Angular CLI: 11.1.3
Node: 14.15.4
OS: linux x64

Angular: 11.1.2
... animations, cdk, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router
Ivy Workspace: <error>

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1100.7
@angular-devkit/build-angular   0.1101.3
@angular-devkit/core            11.0.7
@angular-devkit/schematics      11.0.7
@angular/cli                    11.1.3
@schematics/angular             11.0.7
@schematics/update              0.1101.3
rxjs                            6.6.3
typescript                      4.1.3
    

Anything else relevant?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:15
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
ld210commented, Feb 25, 2021

Same issue here. I was forced to turn off the Angular:Experimental-ivy option in the Angular Language Service extension.

How/where do you turn off the Angular:Experimental-ivy ? Could you please provide a code snippet?

Sorry, VSCode, yes. You can also search for the Angular Service extension in the extension panel and then click on the extension setting icon.

1reaction
vposdcommented, Feb 25, 2021

@ray-kay in VSCode, go to File -> Preferences -> Settings and type Angular:Experimental-ivy on the search box

Read more comments on GitHub >

github_iconTop Results From Across the Web

Type-checking templates in Angular View Engine and Ivy
It shows us that Angular treats a component's template as a partial TypeScript file. ... when Ivy has to inline TCB blocks into...
Read more >
Template type checking - Angular
Overview of template type checkinglink. Just as TypeScript catches type errors in your code, Angular checks the expressions and bindings within theΒ ...
Read more >
Angular Template Type Checking - JavaScript in Plain English
In Angular 9, a neat new template type checking mode has been introduced, called strictTemplates. Let me tell your what it is and...
Read more >
Angular Cli support for inline templates and css - Stack Overflow
In the current version of the CLI (version 6) I just created a new project with ng new foo -s -t . The...
Read more >
Language Service: This component requires inline template type ...
Language Service: This component requires inline template type-checking, which is not supported by the current environment.(-998900)
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found