octokit / octokit.js

The all-batteries-included GitHub SDK for Browsers, Node.js, and Deno.
MIT License
6.93k stars 1.01k forks source link

[BUG]: [Package Error] "@octokit/core@v5.0.0" could not be built. (skypack) #2496

Closed jehon closed 1 year ago

jehon commented 1 year ago

What happened?

I use octokit by importing it like this:

import { Octokit } from "https://cdn.skypack.dev/@octokit/rest";

The script fail at building: Unexpected token (13:9) in @octokit/core/dist-web/index.js

If I look at https://cdn.skypack.dev/error/build:@octokit/core@v5.0.0-qb8w1CDc8GFGwpCOchYZ, the file is invalid.

Suggestion: test the dist-web before publishing to skypack?

Versions

Octokit latest version from skypack => core v5.0.0 according to the log

I use this in a Firefox 115.0 on windows 10. Reproduced on Chrome and Edge-chrome-stuff.

Relevant log output

In the console, I receive this warning:

[Package Error] "@octokit/core@v5.0.0" could not be built. (Imported by "@octokit/rest").
[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/@octokit/core/dist-web/index.js
  Unexpected token (13:9) in @octokit/core/dist-web/index.js
Install failed.
Install failed.

and this error:

Uncaught Error: [Package Error] "@octokit/core@v5.0.0" could not be built. (Imported by "@octokit/rest").
    <anonymous> https://cdn.skypack.dev/error/build:@octokit/core@v5.0.0-qb8w1CDc8GFGwpCOchYZ?from=@octokit/rest:20


### Code of Conduct

- [X] I agree to follow this project's Code of Conduct
gr2m commented 1 year ago

We do't publish to skypack, skypack is pulling from the npm registry. Skypack is no longer maintained, please try esm.sh

jehon commented 1 year ago

Great! it works with esm.sh.... Closing this.