Skip to content

AoT v0.5.1 Module node_modules/angular2-logger/core has no exported member LOG_LOGGER_PROVIDERS #101

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
philjones88 opened this issue Dec 20, 2016 · 8 comments

Comments

@philjones88
Copy link

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

@langley-agm
Copy link
Contributor

What is AoT?

@philjones88
Copy link
Author

@langley-agm
Copy link
Contributor

Gotcha, do you mind sharing an example with your issue reproduceable?

@philjones88
Copy link
Author

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

@philjones88
Copy link
Author

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 :)

@vkniazeu
Copy link

vkniazeu commented Mar 18, 2017

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!

@langley-agm
Copy link
Contributor

@vkniazeu Thanks for the feedback, I'm working on this issue atm, trying to find a way for both configurations to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants