question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No provider for StyleUtils!

See original GitHub issue

Hi 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:closed
  • Created 4 years ago
  • Reactions:21
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
CaerusKarucommented, Feb 7, 2020

@kaseymccormick Your demo uses v8 of Angular with v9 of Flex Layout. Bumping all deps to latest fixes it.

6reactions
tran4ocommented, Feb 2, 2020

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 {}

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't use Flex in new Angular-8 application - Stack Overflow
When I use Flex in my new Angular 8 app, I face this Error message. ERROR. Error: StaticInjectorError(AppModule)[DefaultLayoutDirective -> ...
Read more >
angular/flex-layout - Gitter
Hi, I have problem with jest test when I add flex-layout to my component, the exception is below: ○ TopMenuComponent › should create...
Read more >
Angular No Provider For Baseservice - StackBlitz
Starter project for Angular apps that exports to the Angular CLI.
Read more >
ngx-style-utils - npm Package Health Analysis - Snyk
Ensure you're using the healthiest npm packages. Snyk scans all the packages in your projects for vulnerabilities and provides automated fix ...
Read more >
UNPKG - @angular/flex-layout
src/lib/core/browser-provider.ts","../. ... src/lib/core/style-utils/style-utils.ts","../. ... IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found