Closed uemura5683 closed 5 months ago
@uemura5683 It works within Astro if you install it via Node and import the scripts into a standard script tag!
What has been working for me:
<script>
import "@splidejs/splide/css";
import Splide from "@splidejs/splide";
new Splide(".splide", {
type: "loop",
gap: "20vw",
focus: "center",
}).mount();
</script>
Thank you! I will check it out!
I will contact you if there are any questions! Thank you very much.
This is not working for me, via npm and import in client script as @agrattan0820 suggested, or via CDN with is:inline
directive in the script.
Were you able to get SplideJS working in your AstroJS project, @uemura5683 ?
Please see AstroJS component support #1171 for @Robin-Wils example that uses the npm package.
Checks
Version
v4.1.4
Description
I implemented CDN as follows in Astro, but I encountered an error stating "assert.ts:12 Uncaught Error: [splide] null is invalid." Could you please inform me of the cause? There are no errors related to Astro.
Reproduction Link
No response
Steps to Reproduce
1.Install Astro. 2.Generate index.astro and insert the following code.
Expected Behaviour
I hope for the error to be resolved so that splide.js can function within the Astro framework.