skypackjs / skypack-cdn

An issue tracker for the CDN
107 stars 5 forks source link

[Package Error] "lru-cache@v9.1.1" could not be built. (Imported by "@octokit/auth-app"). #354

Open ipselon opened 1 year ago

ipselon commented 1 year ago
/*
 * [Package Error] "lru-cache@v9.1.1" could not be built. (Imported by "@octokit/auth-app").
 *
 *   [1/5] Verifying package is valid…
 *   [2/5] Installing dependencies from npm…
 *   [3/5] Building package using esinstall…
 *   Running esinstall...
 *   Failed to load node_modules/lru-cache/dist/mjs/index.js
 *     Unexpected token (406:4) in lru-cache/dist/mjs/index.js
 *   Install failed.
 *   Install failed.
 *
 * How to fix:
 *   - If you believe this to be an error in Skypack, file an issue here: https://github.com/skypackjs/skypack-cdn/issues
 *   - If you believe this to be an issue in the package, share this URL with the package authors to help them debug & fix.
 *   - Use https://skypack.dev/ to find a web-friendly alternative to find another package.
 */

console.warn("[Package Error] \"lru-cache@v9.1.1\" could not be built. (Imported by \"@octokit/auth-app\").\n[1/5] Verifying package is valid…\n[2/5] Installing dependencies from npm…\n[3/5] Building package using esinstall…\nRunning esinstall...\nFailed to load node_modules/lru-cache/dist/mjs/index.js\n  Unexpected token (406:4) in lru-cache/dist/mjs/index.js\nInstall failed.\nInstall failed.");
throw new Error("[Package Error] \"lru-cache@v9.1.1\" could not be built. (Imported by \"@octokit/auth-app\").");
export default null;
gr2m commented 1 year ago

This is the line it chokes on for you: https://unpkg.com/browse/lru-cache@9.1.1/dist/mjs/index.js#L406

The # is a private class field, it's supported since Node 12? https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_class_fields

Is this a problem with lru-cache or with skypack?

gr2m commented 1 year ago

It seems to be working fine on esm.sh:

https://esm.sh/v122/lru-cache@9.1.1/es2022/lru-cache.mjs

FrankOVD commented 1 year ago

I have the same issue on Google Chrome v113. I only need to have this line at the beginning of the module.

It used to work just fine.

import { Octokit, App } from "https://cdn.skypack.dev/octokit";

whaaaley commented 1 year ago

So does skypack just not work with private classes? Is that the issue here? Using unkpg in the meantime: https://unpkg.com/lru-cache@9.1.1/dist/mjs/index.js