Alerts in BS 5 not working

Continuing the discussion from Uncaught DOMException: Node.removeChild: The node to be removed is not a child of this node:

I’m posting this as a bug report after adding to the other thread.

When using BS5 Beta, the js scripts created are still BS4 so things like the Alert aren’t working.

MacOS, PHP, Wappler 3.7.4.

Do you mean that you have bs5 on the page as framework but the bs4 script is added?

Yes. I set up a new project, set it as Bootstrap 5 and everything is using BS5 apart from the scripts which are created in my screenshot.

Screenshot 2021-02-08 at 22.26.18

Are you on the latest Wappler 3.7.4?

Yep, sure am :slight_smile:

And how do you add it can you share the generated code?

        <div class="alert" id="alert1" is="dmx-bs5-alert" role="alert" show="true">
            <p>This is a nice alert!</p>

Code looks all good - when are tge bs4 includes added? Directly or on save?

The tags aren’t being added. The code is correct:

<script src="dmxAppConnect/dmxBootstrap5Alert/dmxBootstrap5Alert.js" defer=""></script>

But, the files which are saved are BS4 so the page fails because it can’t find the BS5 files.

See my earlier screenshot which is from the Project Folder.

you screenshot is just about newly generated bs4 map files - that are just updated… nothing to do with your current page.

But the scripts are looking for BS5 files which don’t exist. This is the console:

Uncaught DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
    at n.update (https://loler.local/dmxAppConnect/dmxBootstrap5Alert/dmxBootstrap5Alert.js:7:1295)
    at n.render (https://loler.local/dmxAppConnect/dmxBootstrap5Alert/dmxBootstrap5Alert.js:7:990)
    at n.constructor (https://loler.local/dmxAppConnect/dmxAppConnect.js:7:22761)
    at n (https://loler.local/dmxAppConnect/dmxAppConnect.js:7:9336)
    at n.constructor (https://loler.local/dmxAppConnect/dmxBootstrap5Alert/dmxBootstrap5Alert.js:7:125)
    at new n (https://loler.local/dmxAppConnect/dmxAppConnect.js:7:9336)
    at n.$addChild (https://loler.local/dmxAppConnect/dmxAppConnect.js:7:25409)
    at n.<anonymous> (https://loler.local/dmxAppConnect/dmxAppConnect.js:7:26674)
    at Object.walk (https://loler.local/dmxAppConnect/dmxAppConnect.js:7:12939)
    at https://loler.local/dmxAppConnect/dmxAppConnect.js:7:13046

Well, this error will be fixed in the next update. You can download the js file attached to this topic:

Also the source map files are not scripts and are not required for the components to function properly.

1 Like

This has been fixed in Wappler 3.7.5

1 Like

This topic was automatically closed after 45 hours. New replies are no longer allowed.