PeytonRG/BootstrapToaster

"undefined" as both title and message for all Toasts created

eamonniknafs opened this issue · 4 comments

<head lang="en">
    <link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="node_modules/bootstrap-icons/font/bootstrap-icons.css" rel="stylesheet">
    <link rel="stylesheet" href="node_modules/bootstrap-toaster/css/bootstrap-toaster.min.css" />
    <link rel="stylesheet" href="./style.css">

    <script src="node_modules/jquery/dist/jquery.min.js" type="application/javascript"></script>
    <script src="node_modules/bootstrap/dist/js/bootstrap.min.js" type="application/javascript"></script>
    <script src="node_modules/socket.io-client/dist/socket.io.min.js" type="application/javascript"></script>
</head>
<body>
    ...
    <script src="node_modules/bootstrap-toaster/js/bootstrap-toaster.min.js"></script>
    <script> window.onload = function() {
          Toast.create("Wow, that was easy!", "Just like that, this toast will appear on the page", TOAST_STATUS.SUCCESS, 5000);}
    </script>
</body>

image

I won't have my computer that I develop on with me for a while, so I can't be a great help, but what versions of Bootstrap and Bootstrap Toaster do you have installed?

Make sure to use 5.x if you are running Bootstrap 5, and if you're using Bootstrap 4, use 4.x.

Latest for both. Here is my package.json:

{
  "dependencies": {
    "bootstrap": "^5.0.2",
    "bootstrap-toaster": "^5.1.0-rc1",
    "jquery": "^3.6.0",
    "resumablejs": "^1.1.0",
    "socket.io-client": "^4.1.3"
  }
}

Changed bootstrap-toaster to an older version in my package.json, and reinstalled dependencies. Everything works now!
"bootstrap-toaster": "^5.0.0"

Glad you got it working! Yeah I’ve made a lot of changes in 5.1.0 so I haven’t officially released it yet