mdb-icon is not a known module


Topic: mdb-icon is not a known module

Sanchez Lopez asked 6 years ago

Hi!

When I try to use any component in my angular project I'm reporting some errors in console. For example:

compiler.js:2430 Uncaught Error: Template parse errors: 'mdb-icon' is not a known element: 1. If 'mdb-icon' is an Angular component, then verify that it is part of this module. 2. If 'mdb-icon' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component

I have installed MD Boostrap vía npm install and I have not made any import in my modules according to Getting Started docs. Some extra info:

  • Angular CLI: 7.3.8
  • Node: 10.15.2
  • Angular: 7.2.13

About my angular.json styles node:

"styles": [ "src/styles.css" ],

Thanx for help!


Got the same after following "quick-start" guide. I use only MDBBootstrapModule.forRoot(). Should it include mdb-icon directive?

Got an error

error NG8001: 'mdb-icon' is not a known element:
1. If 'mdb-icon' is an Angular component, then verify that it is part of this module.
2. If 'mdb-icon' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

Arkadiusz Idzikowski staff commented 5 years ago

The IconsModule is part of MDBBootstrapModule so it should work correctly. Are you sure that the component in which you try to use mdb-icon component is part of the same module in which you imported MDBBootstrapModule? If you use lazy loading then you need to import our modules in lazy loaded module again.


Davis M answered 5 years ago

Getting the same error with Angular CLI: 9.1.6Node: 12.16.3


Arkadiusz Idzikowski staff commented 5 years ago

We need more information about your app.module (and/or other modules) configuration. Do you use lazy loading in your app?


Arkadiusz Idzikowski staff answered 6 years ago

Please take a look at our quick start guide and update your app.module and angular.json files:

https://mdbootstrap.com/docs/angular/getting-started/quick-start/


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 7.5.0
  • Device: Laptop
  • Browser: Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No
Tags