icons icon indicating copy to clipboard operation
icons copied to clipboard

CDN buttons blocked by CORS

Open vpreponen opened this issue 9 months ago • 1 comments

I'm trying to follow the instructions on an Astro site:

CDN

Add the following script to the

of your site: <script src="https://cdn.vidstack.io/icons" type="module"></script>

Use the element (icons are lazy loaded): <media-icon type="play"></media-icon>

This results in a CORS error:

Access to script at 'https://cdn.vidstack.io/npm/[email protected]/dist/icons/play.js/+esm' from origin 'http://localhost:4321' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
GET https://cdn.vidstack.io/npm/[email protected]/dist/icons/play.js/+esm net::ERR_FAILED 421 (Misdirected Request)
Uncaught (in promise) TypeError: Failed to fetch dynamically imported module: https://cdn.vidstack.io/npm/[email protected]/dist/icons/play.js/+esm

vpreponen avatar Mar 25 '25 09:03 vpreponen

I have the same issue. This url responds with 421: https://cdn.vidstack.io/npm/[email protected]/dist/icons/picture-in-picture.js/+esm

fredrik-sogaard avatar Jun 04 '25 12:06 fredrik-sogaard