0

After deploying my App on the production server - GitLab/Docker. I get the following error:

ERROR Error: No provider for t!
at C (vendor.32b03a44e7dc21762830.bundle.js:1)
at k (vendor.32b03a44e7dc21762830.bundle.js:1)
at t._throwOrNull (vendor.32b03a44e7dc21762830.bundle.js:1)
at t._getByKeyDefault (vendor.32b03a44e7dc21762830.bundle.js:1)
at t._getByKey (vendor.32b03a44e7dc21762830.bundle.js:1)
at t.get (vendor.32b03a44e7dc21762830.bundle.js:1)
at je (vendor.32b03a44e7dc21762830.bundle.js:1)
at t.get (vendor.32b03a44e7dc21762830.bundle.js:1)
at dn (vendor.32b03a44e7dc21762830.bundle.js:1)
at pn (vendor.32b03a44e7dc21762830.bundle.js:1)

I believe that such errors were/are posted here on the platform, but they affect totally other features. To be honest, I just can't find the solution for my issue. The strange behavior is that the app was working a fine couple of minutes ago, but suddenly when I called the page once more, I can't load the app because of the mentioned error.

The point is that I even can't localize the affected file, component or module. I even don't know and understand the error!

Any Hint other idea please how to fix this?

Iman Bahrampour
  • 6,180
  • 2
  • 41
  • 64
k.vincent
  • 3,743
  • 8
  • 37
  • 74
  • https://github.com/salemdar/angular2-cookie/issues/37 – Sajeetharan Oct 25 '17 at 16:31
  • @Sajeetharan: Unfortunately didn't help... none of the provided hints on [https://github.com/salemdar/angular2-cookie/issues/37](https://github.com/salemdar/angular2-cookie/issues/37) did help. And I don't understand why it should handle with Cookies.. I'am not using cookies. – k.vincent Oct 25 '17 at 16:58
  • 1
    does it work well on `ng serve` locally ? – Rahul Singh Oct 25 '17 at 17:51
  • @RahulSingh: Unfortunately not... error: `ERROR Error: No provider for ChildrenOutletContexts!` Has it to do with router module? – k.vincent Oct 25 '17 at 18:09
  • Yes i guess you have some spec that you test and that is failing check this https://stackoverflow.com/a/45180393/2708210 – Rahul Singh Oct 25 '17 at 18:12
  • @RahulSingh: No, not the unit test files `.spec`. It's fixed now. Was really a issue with router. But you hint with just `ng serve` did give me the idea which files could be affected. – k.vincent Oct 25 '17 at 18:37
  • great if it works @k.vincent – Rahul Singh Oct 25 '17 at 18:38

1 Answers1

0

Fixed. It was an issue with the router which was missing in imports:[...]. Here is what I had to add in add.module.ts:

    @NgModule({
    declarations: [
        ...
    ],
    imports: [
        RouterModule,
        NoConflictStyleCompatibilityMode, RouterModule.forRoot(router)
    ],
    entryComponents:[...],
    providers: [...],
    bootstrap: [AppComponent]
})

The point is that I already did have it before in imports:[] but for some reason I did remove it without paying attention.

k.vincent
  • 3,743
  • 8
  • 37
  • 74