Hi,
I have an app that works fine in dev mode. Now I’m building it in prod mode because the app is almost ready. The app compiles fine, but when I open it I get this error:
Uncaught Error: StaticInjectorError(AppModule)[AddonNotificationsModule -> CoreAppProvider]:
StaticInjectorError(Platform: core)[AddonNotificationsModule -> CoreAppProvider]:
NullInjectorError: No provider for CoreAppProvider!
at _NullInjector.get (core.js:1003)
at resolveToken (core.js:1301)
at tryResolveToken (core.js:1243)
at StaticInjector.get (core.js:1111)
at resolveToken (core.js:1301)
at tryResolveToken (core.js:1243)
at StaticInjector.get (core.js:1111)
at resolveNgModuleDep (core.js:10896)
at _callFactory (core.js:10960)
at _createProviderInstance$1 (core.js:10910)
I don’t understand why is this happening, this provider is declared in my app.module.ts:
import { CoreAppProvider } from '@providers/app';
...
providers: [
CoreAppProvider,
...
]
@providers is an alias that we defined in our own webpack.config.js.
AddonNotificationsModule is a separate module that uses CoreAppProvider in its constructor. This module is imported in app.module.ts:
import { AddonNotificationsModule } from '@addon/notifications/notifications.module';
...
imports: [
...
AddonNotificationsModule,
...
Any idea of what could be going on? How can I debug this error?
Thank you!