You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
forwardRef run-time error with ES2015 output under bazel #29107
As of Angular version 8, the bazel setup switched to ES2015 output by default. This surfaces an issue with the Angular compiler where use of forwardRef results in broken code.
MatCalendar is referenced in the __decorate block of MatCalendarHeader because it's used in the type position for a constructor param
MatCalendar is declared afterMatCalendarHeader
MatCalendar is declared with var.
With the ES2015 output, the result is mostly the same, except that the use of var is now let. This causes a run-time error because the value of MatCalendar is read before it is initialized.
The workaround for this it to modify the tsconfig used by bazel to include
Just for later reference: I think this only surfaces within Bazel as the Bazel & Angular setup by default does not use tsickle, while usually developers build Angular apps with tsickle which:
Removes the TypeScript generated metadata (e.g. the __decorate calls)
Tsickle wraps the metadata retrieval in a closure. Meaning that it works like kind of like forwardRef
Activity
devversion commentedon Mar 5, 2019
Just for later reference: I think this only surfaces within Bazel as the Bazel & Angular setup by default does not use
tsickle, while usually developers build Angular apps withtsicklewhich:__decoratecalls)forwardRefchore: update master to angular version 8 beta
chore: update master to angular version 8 beta
chore: update master to angular version 8 beta
chore: update master to angular version 8 beta
chore: update master to angular version 8 beta
chore: update master to angular version 8 beta
chore: update master to angular version 8 beta
chore: update master to angular version 8 beta
chore: update master to angular version 8 beta (#15392)
alexeagle commentedon Apr 25, 2019
We removed tsickle from the default compiler setup, so now this is an issue for all developers under differential loading. Raising frequency.
alexeagle commentedon May 9, 2019
let's track it in the duplicate #30106
angular-automatic-lock-bot commentedon Sep 15, 2019
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.