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 @Input
decorators 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:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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 !
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