Skip to content
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

Error: Uncaught (in promise): TypeError: r is not a constructor #229

Closed
dgroh opened this issue Nov 1, 2017 · 3 comments
Closed

Error: Uncaught (in promise): TypeError: r is not a constructor #229

dgroh opened this issue Nov 1, 2017 · 3 comments

Comments

@dgroh
Copy link

dgroh commented Nov 1, 2017

Hello,

I just followed the docs and when using

ng build --prod I get the following error:

image

It works if I don't run in prod mode.

Here is my AppModule:

import { NgModule } from "@angular/core";
import { Router } from "@angular/router/";

import { NgIdleModule } from "@ng-idle/core";

import { AppComponent } from "app/app.component";
import { AppRoutingModule } from "app/app-routing.module";

import { CoreModule } from "app/core/core.module";
import { SharedModule } from "app/shared/shared.module";

// Import your library
import { SampleModule } from "@lotes/angular-library-name";

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    NgIdleModule.forRoot(),
    CoreModule.forRoot(),
    SharedModule.forRoot(),
    AppRoutingModule,
    SampleModule
  ],
  bootstrap: [AppComponent],
  providers: [{ provide: "Window", useValue: window } ]
})
export class AppModule {
}

Here my app.component.html:

<sample-component>
  This component is part of the shared library and will now work as expected.
</sample-component>

Is there any issue with AOT? Why is it not working in prod mode?

@dgroh dgroh mentioned this issue Nov 1, 2017
@dgroh
Copy link
Author

dgroh commented Nov 3, 2017

I recreated the package and the problem was gone

@dgroh dgroh closed this as completed Nov 3, 2017
@abdatta
Copy link

abdatta commented Jan 3, 2018

I get a similar error in a different package. Can you tell me how you fixed it?

@dolanmiu
Copy link

dolanmiu commented Feb 3, 2018

I am getting this issue too:

dolanmiu/ng-color#12

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