Topic: Uncaught Error: TOAST and Uncaught ReferenceError: mdb is not defined after upgrade from free version

Stig Kølbæk priority asked 2 years ago


After upgrading from the Free MDB version to Pro I am getting the following errors:

mdb.min.js:310 Uncaught Error: TOAST: Option "animation" provided type "string" but expected type "boolean".
    at VM96433 mdb.min.js:310
    at Array.forEach (<anonymous>)
    at s (VM96433 mdb.min.js:310)
    at r.value (VM96433 mdb.min.js:316)
    at new r (VM96433 mdb.min.js:316)
    at r.<anonymous> (VM96433 mdb.min.js:316)
    at new r (VM96433 mdb.min.js:316)
    at VM96433 mdb.min.js:316
    at Array.forEach (<anonymous>)
    at Module.n (VM96433 mdb.min.js:316)
(anonymous) @ mdb.min.js:310
s @ mdb.min.js:310
value @ mdb.min.js:316
r @ mdb.min.js:316
(anonymous) @ mdb.min.js:316
r @ mdb.min.js:316
(anonymous) @ mdb.min.js:316
n @ mdb.min.js:316
r @ mdb.min.js:316
(anonymous) @ mdb.min.js:316
(anonymous) @ mdb.min.js:19
(anonymous) @ mdb.min.js:19

all.min.js:290 Uncaught ReferenceError: mdb is not defined
    at Module.<anonymous> (VM96434 all.min.js:290)
    at o (VM96434 all.min.js:290)
    at EcommerceGallery (VM96434 all.min.js:290)
    at VM96434 all.min.js:290

Resources (screenshots, code snippets etc.)

I have defined the following in HEAD:

<!-- Google Fonts Roboto -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap"/>
<!-- MDB ESSENTIAL -->
<link rel="stylesheet" href="https://domain.dk/css/mdb.min.css" />
<!-- MDB PLUGINS -->
<link rel="stylesheet" href="https://domain.dk/plugins/css/all.min.css" />

And the foloowing between and tags:

  <!-- MDB ESSENTIAL -->
  <script type="text/javascript" src="https://domain.dk/js/mdb.min.js"></script>
  <!-- MDB PLUGINS -->
  <script type="text/javascript" src="https://domain.dk/plugins/js/all.min.js"></script>

My project needs and use jQuery 3.5.1.

Can you help me find a solution? :-)


Dawid Wajszczuk staff commented 2 years ago

Hi. Can you provide a piece of code responsible for your Toast? A snippet would be nice https://mdbootstrap.com/snippets/. Are you using some of our plugins in this project?


Dawid Wajszczuk staff answered 2 years ago


Hi,

In your snippet, the problem occurs due to lack of -mdb- in data attributes. For example, you need to use data-mdb-animation="true". You can see it in examples from our documentation https://mdbootstrap.com/docs/standard/components/toasts/. Here is the snippet with your example but without errors https://mdbootstrap.com/snippets/standard/d-wajszczuk/3408297.

Keep coding,
Dawid


Stig Kølbæk priority answered 2 years ago


Hi Dawid,

Great, that fixed the issue, thank you :-)

/Stig


Stig Kølbæk priority answered 2 years ago


Hi Dawid,

I have created the below snippet .. regarding plugins, then I was planning on using them, so I had hoped to include them, but for now I have removed them from code.

https://mdbootstrap.com/snippets/standard/skkolbaek-com/3407014



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: Priority
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 3.9.0
  • Device: HP FireFly
  • Browser: Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No