AoT v0.5.1 Module node_modules/angular2-logger/core has no exported member LOG_LOGGER_PROVIDERS
AoT doesn't seem to like:
import { Logger, LOG_LOGGER_PROVIDERS } from 'angular2-logger/core';
Errors with:
Error at /Users/phil/Documents/Projects/aot/src/app/app.module.ngfactory.ts:281:39: Module '"/Users/phil/Documents/Projects/node_modules/angular2-logger/core"' has no exported member 'LOG_LOGGER_PROVIDERS'.
Error at /Users/phil/Documents/Projects/aot/src/app/app.module.ngfactory.ts:732:44: Module '"/Users/phil/Documents/Projects/node_modules/angular2-logger/core"' has no exported member 'LOG_LOGGER_PROVIDERS'.
Angular 2.3.1 Typescript 2.0.10
What is AoT?
@langley-agm https://angular.io/docs/ts/latest/cookbook/aot-compiler.html
Maybe see also https://medium.com/@isaacplmann/making-your-angular-2-library-statically-analyzable-for-aot-e1c6f3ebedd5#.1vvjzjr22
Gotcha, do you mind sharing an example with your issue reproduceable?
I've worked around it via:
import { Logger, Options, Level } from 'angular2-logger/core';
then inside my NgModule:
Logger,
{ provide: Options, useValue: { level: Level.LOG } },
basically, manually doing what the LOG_LOGGER_PROVIDERS does
Looks like https://github.com/Stabzs/Angular2-Toaster just went 2.0.0 and is now fully AoT and UMD. Might be an idea to borrow how they have done things :)
I'm getting a related error trying to build an AoT optimized app:
build prod failed: Error encountered resolving symbol values statically. Only initialized variables and constants can be referenced because the value of this variable is needed by the template compiler (position 47:14 in the original .ts file), resolving symbol DEBUG_LOGGER_PROVIDERS in /node_modules/angular2-logger/core.d.ts
I'm new to AoT, but here are some AoT Do's and Don'ts: https://github.com/rangle/angular-2-aot-sandbox#aot-dos-and-donts
Doing what Phil did above bypassed the issue!
@vkniazeu Thanks for the feedback, I'm working on this issue atm, trying to find a way for both configurations to work.