octokit.js: [BUG]: Unable to import from Skypack CDN
What happened?
Error loading https://cdn.skypack.dev/@octokit/core from CDN.
[Package Error] “lru-cache@v9.1.1” could not be built. (Imported by “@octokit/auth-app”).
Details are here: https://github.com/skypackjs/skypack-cdn/issues/354
Versions
https://cdn.skypack.dev/@octokit/core
Relevant log output
/*
[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;
Code of Conduct
- I agree to follow this project’s Code of Conduct
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 5
- Comments: 32 (16 by maintainers)
Commits related to this issue
- chore: esm.sh instead of skypack.dev Fix failure in running file-freshness.js (https://github.com/octokit/octokit.js/issues/2450) — committed to italia/publiccode-parser-go by bfabio 8 months ago
- chore: esm.sh instead of skypack.dev (#151) Fix failure in running file-freshness.js (https://github.com/octokit/octokit.js/issues/2450) — committed to italia/publiccode-parser-go by bfabio 8 months ago
Please try using the version on
esm.shinstead. There seems to be a problem with SkypackSwitch your imports to https://esm.sh/octokit
I am facing the same issue with >=2.0.15
import { App, Octokit } from 'https://cdn.skypack.dev/octokit?dts';https://cdn.skypack.dev/octokit@2.0.14?dtsseems to be the last workable version.Yes, please open an issue on that repository.
I’ll have to look into that. The export is definitely there in the source code
Private class fields is an ES2022 feature, while the Skypack CDN uses ES2019 which makes it choke on that line.
https://dev.to/smitterhane/private-class-fields-in-javascript-es2022-3b8
The feature may have been supported in NodeJS v12 back when it was still a proposal and not ratified into the ECMAScript spec
This import is resolving our issues in Deno. Thank you!
@ipselon @Netail Can you try again, with this new release
@Netail Thank you for your valuable comment! I’ll keep tracking on this error:)