Skip to content

CDN buttons blocked by CORS #2

Description

@vpreponen

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/media-icons@1.1.5/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/media-icons@1.1.5/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/media-icons@1.1.5/dist/icons/play.js/+esm

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions