SBoudrias / Inquirer.js

A collection of common interactive command line user interfaces.
MIT License
20.09k stars 1.3k forks source link

[Error]: Breaking change introduced in ver. 9.3.6 (TypeError: split called on null or undefined) #1561

Closed maverox closed 2 days ago

maverox commented 1 week ago

@SBoudrias,

Breaking change introduced in this commit https://github.com/SBoudrias/Inquirer.js/commit/ec786623d5094eee357b912cfaab56b4ddd66f05#diff-b24d4a707495e5e2f210d200fab3550db18877ded7d01e729bb73e0c9b103c55

I am using node-plop in my project and after this commit I believe I am getting an error on running only the prompts.

    at split (<anonymous>)
    at travel (file:///Users/ryan/.npm/_npx/08e24d347c8d5920/node_modules/inquirer/lib/ui/prompt.js:20:10)
    at Object.get (file:///Users/ryan/.npm/_npx/08e24d347c8d5920/node_modules/inquirer/lib/ui/prompt.js:27:20)
    at PromptUI.filterIfRunnable (file:///Users/ryan/.npm/_npx/08e24d347c8d5920/node_modules/inquirer/lib/ui/prompt.js:159:9)
    at doInnerSub (/Users/ryan/.npm/_npx/08e24d347c8d5920/node_modules/rxjs/src/internal/operators/mergeInternals.ts:71:15)
    at outerNext (/Users/ryan/.npm/_npx/08e24d347c8d5920/node_modules/rxjs/src/internal/operators/mergeInternals.ts:53:58)
    at OperatorSubscriber.OperatorSubscriber._this._next (/Users/ryan/.npm/_npx/08e24d347c8d5920/node_modules/rxjs/src/internal/operators/OperatorSubscriber.ts:70:13)
    at OperatorSubscriber.Subscriber.next (/Users/ryan/.npm/_npx/08e24d347c8d5920/node_modules/rxjs/src/internal/Subscriber.ts:75:12)
    at <anonymous> (/Users/ryan/.npm/_npx/08e24d347c8d5920/node_modules/rxjs/src/internal/operators/mergeInternals.ts:85:24)
    at OperatorSubscriber.OperatorSubscriber._this._next (/Users/ryan/.npm/_npx/08e24d347c8d5920/node_modules/rxjs/src/internal/operators/OperatorSubscriber.ts:70:13)

I think this is a breaking change

Please look at this issue for more context: https://github.com/plopjs/plop/issues/445

SBoudrias commented 1 week ago

name is required for each prompt, do you know why/where is plop passing one with undefined?

That'd help me understand if it's an issue fixing within Inquirer, or if it's a bug plop needs to fix.

maverox commented 1 week ago

Okay so I was digging into node-plop and it's working and found out that it's only happening when I was using bypassPrompts functionality of runPrompts but runPrompts method without it is simpling running inquirer which was running fine.

I believe the issue is at node-plop's end.

I would like your remark as to whether this is enough to consider this issue resolved and close this issue .

SBoudrias commented 1 week ago

Well I'd like to know someone fixes this on plop side. Seems like it confuses many of their users.

I can push a hotfix to the 9.x release branch.

SBoudrias commented 2 days ago

inquirer@9.3.7 includes a fix - but v10 over won't, so plop will need to fix this internally; or explain how that usage is expected (in which case I'm open to review this change.)