Skip to content

Resolve ATA package versions via package.json - #3695

Merged
Jake Bailey (jakebailey) merged 1 commit into
microsoft:v2from
jakebailey:ata-meta-cors
Nov 6, 2026
Merged

Jake Bailey (jakebailey) merged 1 commit into
microsoft:v2from
jakebailey:ata-meta-cors

Conversation

@jakebailey

Copy link
Copy Markdown
Member

Automatic type acquisition fails for any package imported without an exact version, e.g. import _ from "lodash". unpkg answers a tag or range ?meta request with a redirect to the exact version, but that redirect has no Access-Control-Allow-Origin header, so browsers block it as a CORS violation.

unpkg's redirects for package files do carry CORS headers, so resolve the exact version from package.json first and only request ?meta for that exact version.

Automatic type acquisition fails for any package imported without an
exact version, e.g. `import _ from "lodash"`. unpkg answers a tag or
range ?meta request with a redirect to the exact version, but that
redirect has no Access-Control-Allow-Origin header, so browsers block
it as a CORS violation.

unpkg's redirects for package files do carry CORS headers, so resolve
the exact version from package.json first and only request ?meta for
that exact version.
@jakebailey
Jake Bailey (jakebailey) merged commit a3ed0be into microsoft:v2 Nov 6, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants