re: Sage 10 Bud
I’m yarn installing the following javascript carousel package from: Siema - Lightweight and simple carousel with no dependencies and its failing if the blade include is placed in any other view past app.blade.php eg. content-page.blade.php
I have also tried this with a different javascript package called embla carousel and similar thing happens.
I have tried with fresh install of bud sage (and also bedrock with acorn installed).
My app.js is as follows.
import {domReady} from '@roots/sage/client';
import Siema from 'siema';
/**
* app.main
*/
const main = async (err) => {
if (err) {
// handle hmr errors
console.error(err);
}
};
// fire up Siema Carousel
const mySiema = new Siema({
selector: '.siema',
});
All installs correctly, and if I add the blade include …
@include('partials.sliders.siema')
<div class="siema">
<div>Hi, I'm slide 1</div>
<div>Hi, I'm slide 2</div>
<div>Hi, I'm slide 3</div>
</div>
to app.blade.php:
@include('sections.header')
<main id="main" class="main">
@yield('content')
</main>
@include('partials.sliders.siema')
@hasSection('sidebar')
<aside class="sidebar">
@yield('sidebar')
</aside>
@endif
@include('sections.footer')
the carousel works as expected with no issues or errors.
Problem is, if I try to move the blade include into any other view apart from app.blade eg.
partials > content-page.blade:
@php(the_content())
@include('partials.sliders.siema')
{!! wp_link_pages(['echo' => 0, 'before' => '<nav class="page-nav"><p>' . __('Pages:', 'sage'), 'after' => '</p></nav>']) !!}
then it stops working and throws an error in console:
Uncaught Error: Something wrong with your selector 😭
Anyone else experience this issue with latest version of Bud?
Thanks