Skip to content

TypeError: option.match is not a function #2618

@baywet

Description

@baywet

Thanks for stopping by to let us know something could be better!

Please provide the following details.

Environment details

  • OS: windows
  • Node.js version: 24.11.0 (can also be triggered through node v22)
  • npm version: 11.6.2
  • release-please version: 17.1.3
  • PowerShell version: 7.5.4

Steps to reproduce

  1. ? release-please release-pr --repo-url https://github.com/microsoft/openapi.net --token $TORKEN --dry-run (in powershell, notice I made a mistake in the variable name and it's NOT defined

Logs

C:\Users\user\AppData\Local\nvm\v24.11.0\node_modules\release-please\build\src\util\coerce-option.js:21
    if (option.match(/[\\/]/)) {
               ^

TypeError: option.match is not a function
    at coerceOption (C:\Users\user\AppData\Local\nvm\v24.11.0\node_modules\release-please\build\src\util\coerce-option.js:21:16)
    at C:\Users\user\AppData\Local\nvm\v24.11.0\node_modules\release-please\build\src\bin\release-please.js:65:59
    at C:\Users\user\AppData\Local\nvm\v24.11.0\node_modules\release-please\node_modules\yargs\build\index.cjs:1:4778
    at Array.reduce (<anonymous>)
    at C (C:\Users\user\AppData\Local\nvm\v24.11.0\node_modules\release-please\node_modules\yargs\build\index.cjs:1:4576)
    at _.handleValidationAndGetResult (C:\Users\user\AppData\Local\nvm\v24.11.0\node_modules\release-please\node_modules\yargs\build\index.cjs:1:8966)
    at _.applyMiddlewareAndGetResult (C:\Users\user\AppData\Local\nvm\v24.11.0\node_modules\release-please\node_modules\yargs\build\index.cjs:1:9604)
    at _.runCommand (C:\Users\user\AppData\Local\nvm\v24.11.0\node_modules\release-please\node_modules\yargs\build\index.cjs:1:7231)
    at [runYargsParserAndExecuteCommands] (C:\Users\user\AppData\Local\nvm\v24.11.0\node_modules\release-please\node_modules\yargs\build\index.cjs:1:58539)
    at te.parse (C:\Users\user\AppData\Local\nvm\v24.11.0\node_modules\release-please\node_modules\yargs\build\index.cjs:1:40478)

The condition here should be within the try-catch

if (option.match(/[\\/]/)) {

Making sure to follow these steps will guarantee the quickest resolution possible.

Thanks!

Metadata

Metadata

Assignees

Labels

priority: p3Desirable enhancement or fix. May not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions