Window.swal not working

Fill this out this info to make it easier for the community to help you! If you don’t fill out this information, your post may be deleted or removed.

What Wick Editor Version are you using?

Describe the Problem
Window.swal isn’t working.
Sweet Alert - Importing JS Plugins I used this example but it wont work in my project

What have you tried so far?
Honestly cannot explain it
Do you have a Wick Editor File that we can see? Optional*
Fredric Gems6-15-2022_8-13-06.wick (157.3 KB)

It’s probably because you have to wait for the library to load before you can use it. Here is some code that loads the library and makes a sweet alert once it’s loaded:

function loadScript(id, url)
    // i find promises more cleaner than callback functions
    return new Promise((resolve, reject) => {
        // Adding the script tag to the head as suggested before
        var head = document.head;
        // check if script is already loaded
        var script = document.getElementById("SCRIPT-" + id);
        // if script is loaded, terminate function
        if (script) {
        script = document.createElement('script');
        script.type = 'text/javascript';
        script.onload = resolve;
        script.onerror = reject;
        // name this script so future calls can check if it is already loaded = "SCRIPT-" + id;
        script.src = url;
        // Fire the loading

loadScript("sweetalert", "")
    .then(() => {
        window.swal("SWEET ALERT", "Loaded the Sweet Alert library", "success");

Also you could make dialog boxes in Wick Editor instead of using an external library.