Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: mdb-icon is not a known module

Sanchez Lopez free asked 5 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!


Davis M free answered 4 years ago


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


Arkadiusz Idzikowski staff commented 4 years ago

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


Maksym Mospanenko free answered 4 years ago


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 4 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.


Arkadiusz Idzikowski staff answered 5 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

  • ForumUser: 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