Topic: MDB ADVANCED PRO Kit Plugins import problem

MyHomeTendance priority asked 2 years ago

EDIT : Current thread follows this one.

Expected behavior

I've got my webpack.config.js set up in my Symfony 5.3 app. Everything was working fine until I wanted to start using MDB plugins, such as EcommerceGallery. I installed it with npm, imported it right after MDB itself, and tried instanciating a gallery to test it. Everything should have worked fine.

Actual behavior

I have an error in my console telling me "Reference Error: mdb is not defined."When tracking the issue in the code it seems like the error is triggered when EcommerceGallery first tries to instanciate mdb.Lightbox. I can't figure out what the problem is since mdb is imported right before EcommerceGallery.

Resources (screenshots, code snippets etc.)

My JS code (tried in global app.js, tried in another more specific JS, no difference)

import * as mdb from 'mdb-ui-kit';
import EcommerceGallery from 'mdb-ecommerce-gallery';
window.mdb = mdb;
window.EcommerceGallery = EcommerceGallery;   

I've also tried to define mdb as window object, or even export it after. No difference at all.I've read that other people had the exact same issue. I've also read from other threads that Symfony is not officially supported by MDB. I also know there are webpack integration examples for MDB but I can't make it work in any way.

Anyone can help ? Anyone found a solution for that same problem they already had ?

MyHomeTendance priority answered 2 years ago

Little update here aswell, solution found there.


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



Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 3.9.0
  • Device: Computer
  • Browser: Chromium
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: Yes