JS Carousels not working in partials past app.blade in Sage 10 Bud

So, found a javascript fix for this … I just wrapped the selector variable within a conditional statement:

if(document.getElementById("carousel")){
  const mySiema = new Siema({
    selector: '.siema',
    },
  });
} else {
  console.log("Siema does not exist");
}