Csound Csound-dev Csound-tekno Search About

Re: [Csnd-dev] unpkg CDN

Date2025-04-02 23:40
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd-dev] unpkg CDN

Looks like it's not only us having trouble with unpkg



Prof. Victor Lazzarini
Maynooth University
Ireland

On 2 Apr 2025, at 17:28, vlz <viclazzarini@gmail.com> wrote:


That worked, thanks. Yes, hosting our own may be a good idea.

Prof. Victor Lazzarini
Maynooth University
Ireland

On 2 Apr 2025, at 16:22, Steven Yi <stevenyi@gmail.com> wrote:


Unsure but you could try the jsdelivr link:

https://cdn.jsdelivr.net/npm/@csound/browser@6.18.7/dist/csound.js

I couldn't load the unpkg one in my browser here but the jsdelivr one worked.  

We could also look at hosting these in a repo and publish on github pages so that they're always available. 

On Wed, Apr 2, 2025 at 10:24 AM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
I am having CORS issues with the unpkg CDN. Does anyone know any work-around?

const { Csound } = await import('https://www.unpkg.com/@csound/browser@6.18.7/dist/csound.js’);

gives me (running on a locals server, the same running from github pages)

ping_cdn.html:1 Access to script at 'https://www.unpkg.com/@csound/browser@6.18.7/dist/csound.js' from origin 'http://127.0.0.1:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

ping_cdn.html:23 GET https://www.unpkg.com/@csound/browser@6.18.7/dist/csound.js net::ERR_FAILED 525

ping_cdn.html:35 Uncaught (in promise) TypeError: Failed to fetch dynamically imported module: https://www.unpkg.com/@csound/browser@6.18.7/dist/csound.js

========================
Prof. Victor Lazzarini
Maynooth University
Ireland