Skip to content

InvalidArgumentError: invalid onRequestStart method (node 26.x) #1242

@arlac77

Description

@arlac77

Semantic-release/github stopped working with node 26 for me.

Looks like some incompatibility with the new undid implementation in node:

node --version
v26.0.0
npx semantic-release
...
[12:18:06 PM] [semantic-release] › ✘  An error occurred while running semantic-release: RequestError [HttpError]: invalid onRequestStart method
    at fetchWrapper (file:///XXX/build/pacc/node_modules/@octokit/request/dist-bundle/index.js:78:26)
    at async requestWithGraphqlErrorHandling (file:///XXX/build/pacc/node_modules/@octokit/plugin-retry/dist-bundle/index.js:39:20)
    at async Job.doExecute (/XXX/build/pacc/node_modules/bottleneck/light.js:405:18) {
  status: 500,
  request: {
    method: 'GET',
    url: 'https://api.github.com/repos/arlac77/pacc',
    headers: {
      accept: 'application/vnd.github.v3+json',
      'user-agent': '@semantic-release/github v12.0.8 octokit-core.js/7.0.6 Node.js/26',
      authorization: 'token [REDACTED]'
    },
    request: {
      agent: undefined,
      fetch: [Function: fetchWithDispatcher],
      hook: [Function: bound bound register],
      retryCount: 3,
      retries: 3,
      retryAfter: 16
    }
  },
  response: undefined,
  pluginName: '@semantic-release/github',
  [cause]: TypeError: fetch failed
      at Object.processResponse (/XXX/build/pacc/node_modules/undici/lib/web/fetch/index.js:237:16)
      at /XXX/build/pacc/node_modules/undici/lib/web/fetch/index.js:1081:19
      at /XXX/build/pacc/node_modules/undici/index.js:157:7
      at async fetchWrapper (file:///XXX/build/pacc/node_modules/@octokit/request/dist-bundle/index.js:52:21)
      at async requestWithGraphqlErrorHandling (file:///XXX/build/pacc/node_modules/@octokit/plugin-retry/dist-bundle/index.js:39:20)
      at async Job.doExecute (/XXX/build/pacc/node_modules/bottleneck/light.js:405:18) {
    [cause]: InvalidArgumentError: invalid onRequestStart method
        at assertRequestHandler (node:internal/deps/undici/undici:1873:15)
        at new Request (node:internal/deps/undici/undici:2856:9)
        at [dispatch] (node:internal/deps/undici/undici:9125:25)
        at Client.dispatch (node:internal/deps/undici/undici:736:33)
        at [dispatch] (node:internal/deps/undici/undici:1007:32)
        at Pool.dispatch (node:internal/deps/undici/undici:736:33)
        at [dispatch] (node:internal/deps/undici/undici:9610:27)
        at Agent.dispatch (node:internal/deps/undici/undici:736:33)
        at /XXX/build/pacc/node_modules/undici/lib/web/fetch/index.js:2154:51
        at new Promise (<anonymous>) {
      code: 'UND_ERR_INVALID_ARG'
    }
  }
}
AggregateError:
    HttpError: invalid onRequestStart method
        at fetchWrapper (file:///XXX/build/pacc/node_modules/@octokit/request/dist-bundle/index.js:78:26)
        at async requestWithGraphqlErrorHandling (file:///XXX/build/pacc/node_modules/@octokit/plugin-retry/dist-bundle/index.js:39:20)
        at async Job.doExecute (/XXX/build/pacc/node_modules/bottleneck/light.js:405:18)
    at file:///XXX/build/pacc/node_modules/semantic-release/lib/plugins/pipeline.js:55:13
    at async pluginsConfigAccumulator.<computed> [as verifyConditions] (file:///XXX/build/pacc/node_modules/semantic-release/lib/plugins/index.js:87:11)
    at async run (file:///XXX/build/pacc/node_modules/semantic-release/index.js:106:3)
    at async Module.default (file:///XXX/build/pacc/node_modules/semantic-release/index.js:278:22)
    at async default (file:///XXX/build/pacc/node_modules/semantic-release/cli.js:55:5)%

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions