Skip to content

StaticInjectorError(AppModule)[true]: NullInjectorError: No provider for true! #30267

@rezaeieng1994

Description

@rezaeieng1994

After migration from angular 5 to angular 7 by this guide (https://update.angular.io), I get this error from corejs at the beginning of the web application loading.
First page doesn't load correctly but after it's loaded, everything works fine.
I've used lazy loading and I have a shared module that is used in the App Module, and the rest of the feature modules are loaded through the lazy load routing.
ERROR Error: StaticInjectorError(AppModule)[true]: StaticInjectorError(Platform: core)[true]: NullInjectorError: No provider for true! at _NullInjector.webpackJsonp../node_modules/@angular/core/esm5/core.js._NullInjector.get (core.js:994) at resolveToken (core.js:1292) at tryResolveToken (core.js:1234) at StaticInjector.webpackJsonp../node_modules/@angular/core/esm5/core.js.StaticInjector.get (core.js:1102) at resolveToken (core.js:1292) at tryResolveToken (core.js:1234) at StaticInjector.webpackJsonp../node_modules/@angular/core/esm5/core.js.StaticInjector.get (core.js:1102) at resolveNgModuleDep (core.js:10836) at _createProviderInstance$1 (core.js:10853) at resolveNgModuleDep (core.js:10832)

I'm not sure but in trace of call stack,I guessed the reason because of preloading.
what is wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions