Hello guys !
I am encountering a small bug with setting up multiple bundle()->enqueue()
.
Basically, I’m trying to load a CSS file only when I need it through Composers
or Components
. It all works fine.
bundle('app')->enqueue();
bundle('blocks/hero-banner')->enqueue();
The problem is that I get lots of errors in the console when I load bundle()
more than once.
Uncaught (in promise) DOMException: Failed to execute 'define' on 'CustomElementRegistry': the name "bud-activity-indicator" has already been used with this registry
at new IndicatorController (http://localhost:3000/vendor/bud.app.blocks/hero-banner.blocks/lft-rgt.blocks/border.blocks/pusher.blocks/testimonial.blocks/hp-simulator.blocks/latest-articles.blocks/partner-slide.blocks/push-newsletter.blocks/push-map.testing.js:342:24)
at http://localhost:3000/vendor/bud.app.blocks/hero-banner.blocks/lft-rgt.blocks/border.blocks/pusher.blocks/testimonial.blocks/hp-simulator.blocks/latest-articles.blocks/partner-slide.blocks/push-newsletter.blocks/push-map.testing.js:54:23
So, I lose the hot reload features because the script execution fails.
how to reproduce
In the setup.php file, add a new bundle call like this :
bundle('app')->enqueue();
bundle('testing')->enqueue();
bud.config.js
.entry({
...
'testing': ['styles/blocks/testing.scss'],
});
Am I doing something wrong?
Thank