Topic: Error loading page using mdbpro
Luca Gammelli priority asked 2 years ago
i just buy the pro license. and i would like to add it to an existing project.After i add the mdb.min.js and all.min.js (plugins) i receive the following error:
index.js:181 Uncaught TypeError: Cannot read properties of null (reading 'hasAttribute') at i (index.js:181:32) at Module.i (event-handler.js:16:11) at s (bootstrap:19:22) at bootstrap:83:10 at universalModuleDefinition:9:17 at universalModuleDefinition:1:1i @ index.js:181i @ event-handler.js:16s @ bootstrap:19(anonymous) @ bootstrap:83(anonymous) @ universalModuleDefinition:9(anonymous) @ universalModuleDefinition:1templates.js:38 Uncaught TypeError: Cannot read properties of null (reading 'hasAttribute') at n (templates.js:38:5) at Module.n (templates.js:65:5) at r (bootstrap:2:7) at bootstrap:2:7 at universalModuleDefinition:9:21 at universalModuleDefinition:10:4n @ templates.js:38n @ templates.js:65r @ bootstrap:2(anonymous) @ bootstrap:2(anonymous) @ universalModuleDefinition:9(anonymous) @ universalModuleDefinition:10jquery-3.6.1.min.js:2 jQuery.Deferred exception: mdb is not defined ReferenceError: mdb is not defined
Could you please help ?7
Grzegorz Bujański staff answered 1 year ago
Unfortunately, we don't see the code you posted. In this case, the order of imports is important. Check if you import jQ first and then MDB. What is the index.js: 181 error? What code is there? This is the code related to the MDB component?
Luca Gammelli priority commented 1 year ago
yes index.js:181 error is related to MDB component. Any way i'll check it better at this momento the JQ il loaded after MDB
Grzegorz Bujański staff commented 1 year ago
Ok. If you import first jA and then MDB and you still have this problem, let me know. Then we will need information on what code causes this error.
Kamila Pieńkowska staff answered 1 year ago
It should work without a problem with jQuery. Can you describe how you are doing your imports and if you use any framework?
Luca Gammelli priority commented 1 year ago
At this moment i'm not using the MDB framework. I just neet to load the framework togheter with jquery and start the migration. The problem appears just loading the JS.
The web site is currently developed in Flask and Python.
My loading code is as follow:
At the End of the page:
Removing the jquery script i don't receive any error.
Luca Gammelli priority answered 1 year ago
if i remove the jquery load it works. The current project is based on jquery i'd like to load both and start migration to mdb. is this possible?
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Priority
- Premium support: Yes
- Technology: MDB Standard
- MDB Version: MDB5 5.0.0
- Device: Windows
- Browser: Chrome
- OS: 11
- Provided sample code: No
- Provided link: No