code-chunks/angular2-logger

Angular 6: Runtime error while running prod build

Closed this issue · 0 comments

I just migrated my project from Angular 5 to Angular 6. It works fine in development build but gives the following error in web browser console in production mode:

Uncaught TypeError: Cannot read property 'WARN' of undefined
at Object.GRNk (logger.js:16)
at c (bootstrap:81)
at Object.tlJs (core.js:7)
at c (bootstrap:81)
at Object.AytR (environment.ts:21)
at c (bootstrap:81)
at Object.zUnb (data-grid.js:1168)
at c (bootstrap:81)
at Object.5 (pager.js:562)
at c (bootstrap:81)

This is the culprit line in node_modules/angular2-logger/app/core/logger.js:

level: level_1.Level.WARN,

Edit: It's apparently an issue with angular-devkit/build-optimizer version 0.6.0. I downgraded to 0.5.13 and the issue was gone.