Ubuntu precise (12.04.5 LTS)
angular-cli: 1.0.0-beta.26
node: 6.9.2
os: linux x64
@angular/common: 2.4.5
@angular/compiler: 2.4.5
@angular/core: 2.4.5
@angular/forms: 2.4.5
@angular/http: 2.4.5
@angular/platform-browser: 2.4.5
@angular/platform-browser-dynamic: 2.4.5
@angular/router: 3.4.5
@angular/compiler-cli: 2.4.5
[email protected]
$ ng new testapp
$ cd testapp/
$ npm install angular2-logger --save
$ cd src/app
$ patch -p0 <<-EOF
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index 67ae491..34ef2fa 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -4,6 +4,7 @@ import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { AppComponent } from './app.component';
+import { LOG_LOGGER_PROVIDERS } from "angular2-logger/core";
@NgModule({
declarations: [
@@ -14,7 +15,7 @@ import { AppComponent } from './app.component';
FormsModule,
HttpModule
],
- providers: [],
+ providers: [LOG_LOGGER_PROVIDERS],
bootstrap: [AppComponent]
})
export class AppModule { }
EOF
$ ng build
ERROR in 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 48:14 in the original .ts file), resolving symbol LOG_LOGGER_PROVIDERS in /home/user/testapp/node_modules/angular2-logger/core.d.ts, resolving symbol AppModule in /home/user/testapp/src/app/app.module.ts, resolving symbol AppModule in /home/user/testapp/src/app/app.module.ts
There's a known issue with Angular compiler and export * from ..., which is how LOG_LOGGER_PROVIDERS is exported from "angular2-logger/core".
For a workaround, try importing from "angular2-logger/core/providers" instead, as it seems declared there.
That works, but the exact line is
import { LOG_LOGGER_PROVIDERS } from "angular2-logger/app/core/providers";
Many thanks! This ticket can be closed if unrelated to angular-cli.
I've followed the steps above and i'm still getting an error. I'm using beta 31 of angular-cli.
undefined is not an object (evaluating '_this.logger.info')
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
That works, but the exact line is
import { LOG_LOGGER_PROVIDERS } from "angular2-logger/app/core/providers";Many thanks! This ticket can be closed if unrelated to angular-cli.