Coder Social home page Coder Social logo

Comments (4)

gr2m avatar gr2m commented on July 22, 2024 1

Glad you got it working!

I hope all the compliation-related problems will go away once we fully transition to ES Modules. It will happen eventually, but we cannot give an ETA unfortunately.

from core.js.

github-actions avatar github-actions commented on July 22, 2024

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

from core.js.

gr2m avatar gr2m commented on July 22, 2024

When using in browser, I'd recommend to use a smaller library. octokit comes with a lot of features and code and results in a big bundle size. Could you try if you see the same problem with @octokit/core.

You can also try importing from https://esm.sh. Try

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

to see if you see the same error. If you don't, it might be a problem how the imported octokit module is bundled in your setup

from core.js.

mellson avatar mellson commented on July 22, 2024

Thank you, @gr2m, that's very helpful input 👍🏻

I tried importing Octokit from esm.sh like this import { Octokit } from 'https://esm.sh/octokit';
And that actually works.

What I ended up on, for now, is to only import @octokit/rest in the browser instead of the full Octokit.
However, that still throws the original error - but I got past that by transpiling @octokit/core.
I just added it to our next config:

const nextConfig = {
...rest of config
transpilePackages: ['@octokit/core']
...
}
module.exports = nextConfig

And that works fine.

from core.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.