You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Vite to bundle the Bootstrap Carousel JavaScript, but it is causing an error in the browser console.
I verified that this issue is not specific to Vite, as it also occurs with the final JavaScript build bundled using Webpack.
To help reproduce the issue, I’ve provided a StackBlitz link with only the Carousel component. Please check the browser console after the page finishes loading to see the reported error:
In your example, you are trying to instantiate the carousel with with an element of id myCarousel, but in your DOM, it"s actually carouselExampleIndicators. If you fix your selector in the JS, this error will go away.
Thanks @kyletsang for pointing that out! You"re absolutely correct—the issue is with the mismatched ID between the JavaScript selector and the DOM. I appreciate your help in identifying this. I"ll go ahead and close the issue now.
Prerequisites
Describe the issue
I am using Vite to bundle the Bootstrap Carousel JavaScript, but it is causing an error in the browser console.
I verified that this issue is not specific to Vite, as it also occurs with the final JavaScript build bundled using Webpack.
To help reproduce the issue, I’ve provided a StackBlitz link with only the Carousel component. Please check the browser console after the page finishes loading to see the reported error:
Reduced test cases
I have replicated the issue here : https://stackblitz.com/edit/vitejs-vite-fvpaeypo?file=index.html
What operating system(s) are you seeing the problem on?
macOS
What browser(s) are you seeing the problem on?
Chrome
What version of Bootstrap are you using?
v5.3.3
The text was updated successfully, but these errors were encountered: