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.

Ivy: Should not combine @Input decorators and query decorators

See original GitHub issue

🐞 bug report

Affected Package

@angular/compiler-cli (8.1 rc0)

Is this a regression?

No, same result without Ivy.

Description

With Ivy @Inputdecorators shouldn’t be combined with query decorators such as @ViewChild ( #31056 )

πŸ”¬ Minimal Reproduction

https://github.com/hugodes/repro-decorators

πŸ”₯ Exception or Error

The code compiles without errors but should throw an error.

🌍 Your Environment

Angular Version:


Angular CLI: 8.0.6
Node: 10.16.0
OS: darwin x64
Angular: 8.1.0-rc.0
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.800.6
@angular-devkit/build-angular     0.800.6
@angular-devkit/build-optimizer   0.800.6
@angular-devkit/build-webpack     0.800.6
@angular-devkit/core              8.0.6
@angular-devkit/schematics        8.0.6
@angular/cli                      8.0.6
@ngtools/webpack                  8.0.6
@schematics/angular               8.0.6
@schematics/update                0.800.6
rxjs                              6.5.2
typescript                        3.4.5
webpack                           4.30.0

Anything else relevant? Sometimes the error is thrown ( #31056 ) but not consistently.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
hugodescommented, Jun 28, 2019

@istiti you’re 100% right 🎯. We had aot set to true on our internal project. Never thought to update to aot::true on my repro-repo !

Thank you so much for your time !

1reaction
elvisbegoviccommented, Jun 28, 2019

Ok, I updated my comment and I see your problem please enable aot:true

To understand the problem in JIT (aot:false like you have) no angular compiler is used to proceed your ts files; tsc is used directly, CLI cannot emit you error in console.

But when you set aot:true angular compiler is used and CLI can throw error you see at runtime.

I admit in little project we can see problem quickly but in large project runtime errors are dangerous! But in v8.1 aot is enabled by default with IVY and should solve the problem.

cc @alan-agius4

Read more comments on GitHub >

github_iconTop Results From Across the Web

angular - Cannot combine @Input decorators with query ...
0 and i'am now trying the new compiler ivy. The app works perfectly without ivy but when i try to compile with it...
Read more >
angular/angular-cli - Input - Gitter
Hi, I updated to v8 and the project is building fine. But when I enable Ivy, it shows this error: "Cannot combine @Input...
Read more >
Cannot combine @Input decorators with query decorators
Hi, Β· i'm upgrading to Angular 9. Almost everything works excepts for Karma tests in my SearchModule wich uses the GridModule of Syncfusion....
Read more >
Angular – Cannot combine @Input decorators with query decorators ...
The app works perfectly without ivy but when i try to compile with it i have the following error : Cannot combine @Input...
Read more >
cannot combine @input decorators with query decorators ng ...
Based on the error message, it looks like @input () and @ContentChild decorators are used on the same field in a Component class....
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