Git Product home page Git Product logo

Comments (6)

github-actions avatar github-actions commented on June 9, 2024 1

🎉 This issue has been resolved in version 4.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

from octokit.js.

github-actions avatar github-actions commented on June 9, 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 octokit.js.

s100 avatar s100 commented on June 9, 2024

I'm finding that CJS can't use Octokit 4 either:

a.js:

require('octokit')
C:\...>node a.js
C:\...\a.js:1
require('octokit')
^

Error [ERR_REQUIRE_ESM]: require() of ES Module C:\...\node_modules\octokit\dist-node\index.js from C:\...\a.js not supported.
index.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use dynamic import() which is available in all CommonJS modules, or change "type": "module" to "type": "commonjs" in C:\...\node_modules\octokit\package.json to treat all .js files as CommonJS (using .mjs for all ES modules instead).

    at Object.<anonymous> (C:\...\a.js:1:1) {
  code: 'ERR_REQUIRE_ESM'
}

Node.js v18.17.1

from octokit.js.

wolfy1339 avatar wolfy1339 commented on June 9, 2024

Sorry that is my fault.

I forgot to change the build script

from octokit.js.

wolfy1339 avatar wolfy1339 commented on June 9, 2024

You should be able to point to the files directly in order to import them

import Octokit from "octokit/dist-src/index.js";

from octokit.js.

gr2m avatar gr2m commented on June 9, 2024

I confirmed that this works now:

// test.mjs
import { Octokit } from "octokit";
console.log(Octokit.VERSION);
// 6.1.2

from octokit.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.