Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing value of custom directive in template causes prod build failing. #32761

Closed
mohaxspb opened this issue Sep 18, 2019 · 4 comments
Closed
Labels
area: compiler Issues related to `ngc`, Angular's template compiler
Milestone

Comments

@mohaxspb
Copy link
Contributor

馃悶 bug report

Affected Package

The issue is caused by package @angular/compiler

Is this a regression?

No

Description

If there is custom directive in template and you assign new value to it in template prod build fails.

馃敩 Minimal Reproduction

Repository with example: https://github.com/mohaxspb/ng-var-directive-issue

To get error just run ng build --prod

馃敟 Exception or Error


ERROR in Cannot assign to a reference or variable!

馃實 Your Environment

Angular Version:


Angular CLI: 8.3.4
Node: 10.15.3
OS: win32 x64
Angular: 9.0.0-next.6+80.sha-df1c456.with-local-changes
... animations, bazel, common, compiler, compiler-cli, core
... elements, forms, language-service, localize
... platform-browser, platform-browser-dynamic, platform-server
... platform-webworker, platform-webworker-dynamic, router
... service-worker, upgrade

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.803.4
@angular-devkit/build-angular     0.803.4
@angular-devkit/build-optimizer   0.803.4
@angular-devkit/build-webpack     0.803.4
@angular-devkit/core              8.3.4
@angular-devkit/schematics        8.3.4
@angular/cli                      8.3.4
@ngtools/webpack                  8.3.4
@schematics/angular               8.3.4
@schematics/update                0.803.4
rxjs                              6.4.0
typescript                        3.5.3
webpack                           4.39.2

Anything else relevant?

I'm in progress with PR with fix for it

@AndrewKushnir AndrewKushnir added the area: compiler Issues related to `ngc`, Angular's template compiler label Sep 18, 2019
@ngbot ngbot bot added this to the needsTriage milestone Sep 18, 2019
@Splaktar
Copy link
Member

In the future, it would be best if example directives did not use the ngXX for directives that are not created by Angular. I.e. for your directives use something like *myVar instead of *ngVar.

@mohaxspb
Copy link
Contributor Author

@Splaktar OK, I change it in example)

@alxhub
Copy link
Member

alxhub commented Oct 8, 2019

Closing as a duplicate of #32695.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: compiler Issues related to `ngc`, Angular's template compiler
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants