No provider for StyleUtils!
See original GitHub issueHi there! Sorry for the simple bug report, but its Sunday 😉
Bug Report
What is the expected behavior?
No errors
What is the current behavior?
Runtime gives error: No provider for StyleUtils! Compilation goes fine
error-handler.provider.ts:10 NullInjectorError: StaticInjectorError(AppModule)[DefaultFlexDirective -> StyleUtils]: StaticInjectorError(Platform: core)[DefaultFlexDirective -> StyleUtils]: NullInjectorError: No provider for StyleUtils! at NullInjector.get (http://localhost:4200/vendor.js:40304:27) at resolveToken (http://localhost:4200/vendor.js:54785:24) at tryResolveToken (http://localhost:4200/vendor.js:54711:16) at StaticInjector.get (http://localhost:4200/vendor.js:54552:20) at resolveToken (http://localhost:4200/vendor.js:54785:24) at tryResolveToken (http://localhost:4200/vendor.js:54711:16) at StaticInjector.get (http://localhost:4200/vendor.js:54552:20) at resolveNgModuleDep (http://localhost:4200/vendor.js:66988:29) at NgModuleRef_.get (http://localhost:4200/vendor.js:67848:16) at resolveDep (http://localhost:4200/vendor.js:68373:45)
It keeps happening since upgrading to Angular 9 RC 11 and up, and I can find zero about it on google.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:21
- Comments:11 (4 by maintainers)
Top GitHub Comments
@kaseymccormick Your demo uses v8 of Angular with v9 of Flex Layout. Bumping all deps to latest fixes it.
got the same error after upgrading… temporary solution is to create a module wrapper :
import {NgModule} from ‘@angular/core’; import {FlexLayoutModule} from “@angular/flex-layout”;
import {StyleUtils,StylesheetMap,MediaMarshaller,ɵMatchMedia,BreakPointRegistry,PrintHook,LayoutStyleBuilder,FlexStyleBuilder,ShowHideStyleBuilder,FlexOrderStyleBuilder} from “@angular/flex-layout”;
@NgModule({ exports: [ FlexLayoutModule ], providers: [ StyleUtils,StylesheetMap,MediaMarshaller,ɵMatchMedia,BreakPointRegistry,PrintHook,LayoutStyleBuilder,FlexStyleBuilder,ShowHideStyleBuilder,FlexOrderStyleBuilder
] }) export class FlexModule {}