trzczy
trzczy

Reputation: 1501

Creating new js Octokit object for Github stopped to work

I cannot run octokit for GitHub in my application. It was working for long time but stopped. The error is

Uncaught SyntaxError: The requested module '/@octokit/webhooks-methods@^5.0.0?target=es2022' does not provide an export named 'verifyWithFallback' (at index.js:476:10)

I removed the things of the application to get the minimal application causing the error:

index.html

<script type="module">
    import myFunc from "./myFunc.js";
</script>

myFunc.js

import {Octokit, App} from "https://esm.sh/octokit";
new Octokit({
    auth: 'ghp_1234512345123451234512345'
});
const myFunc = ()=>"foo";
export default myFunc;

Before I did some things with git locally: clone, reset, push. Maybe that was the reason. I also changed the token to the new one, in GitHub and in my application. How to fix the error?

Upvotes: 0

Views: 155

Answers (2)

Valerie Wang
Valerie Wang

Reputation: 19

Have same prblem here but we import octokit by cdn for a long time, don't know why it failed recently

import { Octokit } from 'https://esm.sh/octokit'

Upvotes: -1

trzczy
trzczy

Reputation: 1501

This should be put

import {Octokit} from "https://esm.sh/@octokit/[email protected]";

Upvotes: 0

Related Questions