@angular/compiler
No, but this is more relevant now because angular-cli permits ES2015 targets.
When targeting ES2015, emitDecoratorMetadata causes a ReferenceError.
https://github.com/pauldraper/angular-decorator-metadata
ng serve
Load in browser.
main.js:98 Uncaught ReferenceError: Cannot access 'AppService' before initialization
at Module../src/app.component.ts (main.js:98)
at __webpack_require__ (runtime.js:80)
at Module../src/app.module.ts (main.js:123)
at __webpack_require__ (runtime.js:80)
at Module../src/main.ts (main.js:157)
at __webpack_require__ (runtime.js:80)
at Object.0 (main.js:174)
at __webpack_require__ (runtime.js:80)
at checkDeferredModules (runtime.js:46)
at Array.webpackJsonpCallback [as push] (runtime.js:33)
Angular Version:
Angular 8.1.1
Anything else relevant?
Removing emitDecoratorMetadata, or targeting es5 fixes the problem.
Hi, is there a reason why you need emitDecoratorMetadata to be true?
By the way @pauldraper, love your repo.
This TypeScript option has a fundamental design limitation with ES2015+ code and is best avoided when targeting such output. As such this is an issue with TypeScript itself and not Angular.
Angular 8+ no longer requires the option. It was also previously only required for JIT mode which is typically only used in development.
Maybe it would be good to check for that when upgrading angular, or mention it in the docs? This just took me quiet a bit to figure out after upgrading from angular 7 -> 8
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._
Most helpful comment
Maybe it would be good to check for that when upgrading angular, or mention it in the docs? This just took me quiet a bit to figure out after upgrading from angular 7 -> 8