Skip to content

alphaTab cannot be used directly via jsdelivr CDN anymore (ESM) #1917

@Danielku15

Description

@Danielku15

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When importing alphaTab directly from a CDN like JsDelivr (using ESM imports) we get a bunch of CORS errors when spawning the worker.

[AlphaTab][Rendering] Failed to create WebWorker: SecurityError: Failed to construct 'Worker': Script at 'https://cdn.jsdelivr.net/npm/@coderline/alphatab@latest/dist/alphaTab.worker.min.mjs' cannot be accessed from origin 'http://localhost:3000'.

[AlphaTab][Rendering] Failed to create WebWorker: SecurityError: Failed to construct 'Worker': Script at 'https://cdn.jsdelivr.net/npm/@coderline/alphatab@alpha/dist/alphaTab.worker.min.mjs' cannot be accessed from origin 'http://localhost:3000'.

Expected Behavior

The alphaTab worker and audio worklets (if possible) should launch via the ESM version allowing alphaTab to be used directly via CDNs.

Steps To Reproduce

https://github.com/CoderLine/alphaTabSamplesWeb

Link to jsFiddle, CodePen, Project

No response

Found in Version

1.4 (alpha)

Platform

Web

Environment

- **OS**: Windows 11 Pro
- **Browser**: Chrome

Anything else?

No response

Metadata

Metadata

Assignees

Labels

area-coreRelated to some core parts of alphaTabplatform-javascriptRelated to the JavaScript version of alphaTabstate-acceptedThis is a valid topic to work on.

Type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions