Skip to content

fix: set octokit log option to {} instead of null#1237

Merged
webpro merged 1 commit intorelease-it:mainfrom
efstathiosntonas:patch-1
Jul 16, 2025
Merged

fix: set octokit log option to {} instead of null#1237
webpro merged 1 commit intorelease-it:mainfrom
efstathiosntonas:patch-1

Conversation

@efstathiosntonas
Copy link
Copy Markdown
Contributor

@efstathiosntonas efstathiosntonas commented Jul 14, 2025

probably fixes:

side note:

For some reason the octokit logger will not initialize default to {} when it's null

this is from node_modules/@octokit/core/dist-src/index.js 🤷

function createLogger(logger = {}) {
  if (typeof logger.debug !== "function") {
    logger.debug = noop;
  }
  if (typeof logger.info !== "function") {
    logger.info = noop;
  }
  if (typeof logger.warn !== "function") {
    logger.warn = consoleWarn;
  }
  if (typeof logger.error !== "function") {
    logger.error = consoleError;
  }
  return logger;
}

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jul 14, 2025

Open in StackBlitz

npm i https://pkg.pr.new/release-it@1237

commit: 935053e

@efstathiosntonas efstathiosntonas changed the title fix: set octokit log to {} instead of null fix: set octokit log option to {} instead of null Jul 14, 2025
@johnnydegreefitp
Copy link
Copy Markdown

@efstathiosntonas Ok to merge?

@efstathiosntonas
Copy link
Copy Markdown
Contributor Author

@johnnydegreefitp yes, been using the fix for a while with no issues.

ps. I can't merge

@webpro webpro merged commit 6fc696f into release-it:main Jul 16, 2025
10 checks passed
@webpro
Copy link
Copy Markdown
Collaborator

webpro commented Jul 16, 2025

Thanks, Statis! 🚀

@efstathiosntonas efstathiosntonas deleted the patch-1 branch July 16, 2025 14:55
@efstathiosntonas
Copy link
Copy Markdown
Contributor Author

efstathiosntonas commented Jul 16, 2025

@webpro anytime!

we should update the error logic a bit, it throwed invalid github token while the issue was deeper than that, only -VV switch showed the proper error. Just saying 😅

@webpro
Copy link
Copy Markdown
Collaborator

webpro commented Jul 16, 2025

Feel free to take a stab at it, hopefully the code is somewhat understandable.

@webpro
Copy link
Copy Markdown
Collaborator

webpro commented Jul 16, 2025

🚀 This pull request is included in v19.0.4. See Release 19.0.4 for release notes.

alexandriashai added a commit to alexandriashai/cbrowser that referenced this pull request Feb 7, 2026
Fixes GitHub release creation error:
"Cannot read properties of null (reading 'debug')"

Root cause: octokit logger was set to null instead of {}
Fix: release-it/release-it#1237

- release-it: 17.0.0 → 19.2.4
- @release-it/conventional-changelog: 8.0.0 → 10.0.5

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants