probot / create-probot-app

🤖📦 Create a new probot app
ISC License
235 stars 106 forks source link

create-probot-app fails when looking for user email #286

Closed Chocrates closed 3 years ago

Chocrates commented 3 years ago

I get the following error when running create-probot-app with no extra arguments

$ npx create-probot-app snow_integrator
npx: installed 537 in 12.577s

Let's create a Probot app!
Hit enter to accept the suggestion.

? App name: snow-integrator
? Description of app: A Probot app
? Author's full name: Chris McIntosh
(node:77983) UnhandledPromiseRejectionWarning: TypeError: config.hasOwnProperty is not a function
    at gitUserEmail (/Users/chocrates/.npm/_npx/77983/lib/node_modules/create-probot-app/node_modules/git-user-email/index.js:19:44)
    at Object.guessEmail (/Users/chocrates/.npm/_npx/77983/lib/node_modules/create-probot-app/node_modules/conjecture/index.js:19:13)
    at Object.default (/Users/chocrates/.npm/_npx/77983/lib/node_modules/create-probot-app/bin/create-probot-app.js:125:41)
    at /Users/chocrates/.npm/_npx/77983/lib/node_modules/create-probot-app/node_modules/run-async/index.js:49:25
    at new Promise (<anonymous>)
    at /Users/chocrates/.npm/_npx/77983/lib/node_modules/create-probot-app/node_modules/run-async/index.js:26:19
    at Object.exports.fetchAsyncQuestionProperty (/Users/chocrates/.npm/_npx/77983/lib/node_modules/create-probot-app/node_modules/inquirer/lib/utils/utils.js:23:29)
    at MergeMapSubscriber.project (/Users/chocrates/.npm/_npx/77983/lib/node_modules/create-probot-app/node_modules/inquirer/lib/ui/prompt.js:88:17)
    at MergeMapSubscriber._tryNext (/Users/chocrates/.npm/_npx/77983/lib/node_modules/create-probot-app/node_modules/rxjs/internal/operators/mergeMap.js:67:27)
    at MergeMapSubscriber._next (/Users/chocrates/.npm/_npx/77983/lib/node_modules/create-probot-app/node_modules/rxjs/internal/operators/mergeMap.js:57:18)
    at MergeMapSubscriber.Subscriber.next (/Users/chocrates/.npm/_npx/77983/lib/node_modules/create-probot-app/node_modules/rxjs/internal/Subscriber.js:66:18)
    at MergeMapSubscriber.notifyNext (/Users/chocrates/.npm/_npx/77983/lib/node_modules/create-probot-app/node_modules/rxjs/internal/operators/mergeMap.js:93:26)
    at SimpleInnerSubscriber._next (/Users/chocrates/.npm/_npx/77983/lib/node_modules/create-probot-app/node_modules/rxjs/internal/innerSubscribe.js:27:21)
    at SimpleInnerSubscriber.Subscriber.next (/Users/chocrates/.npm/_npx/77983/lib/node_modules/create-probot-app/node_modules/rxjs/internal/Subscriber.js:66:18)
    at Observable._subscribe (/Users/chocrates/.npm/_npx/77983/lib/node_modules/create-probot-app/node_modules/rxjs/internal/util/subscribeToArray.js:5:20)
    at Observable._trySubscribe (/Users/chocrates/.npm/_npx/77983/lib/node_modules/create-probot-app/node_modules/rxjs/internal/Observable.js:44:25)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:77983) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promi
se which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli
_unhandled_rejections_mode). (rejection id: 3)
(node:77983) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-ze
ro exit code.

Calling it with --email user@email.com works as intended. Not sure if this is an issue with my system or the create-probot-app itself, or how I can debug that.

gr2m commented 3 years ago

Hi @Chocrates, thanks for filing this issue!

At first sight, it might be a problem with https://github.com/jonschlinkert/git-user-email, the error originates in this line:

https://github.com/jonschlinkert/git-user-email/blob/30674ffa69e51003d26811d8f6338e0e5cc46339/index.js#L19-L21

Could you check if you can reproduce the problem when only using git-user-email?

We don't use the package directly, but through https://github.com/boneskull/conjecture, where we use these 3 methods:

https://github.com/probot/create-probot-app/blob/43cec777048046b70a260e8a2d1c789008623bc6/src/create-probot-app.ts#L11

Maybe try the guessEmail directly first and see if you can reproduce the same error?

GitHub
jonschlinkert/git-user-email
Get the current user's git email address. Contribute to jonschlinkert/git-user-email development by creating an account on GitHub.
GitHub
jonschlinkert/git-user-email
Get the current user's git email address. Contribute to jonschlinkert/git-user-email development by creating an account on GitHub.
GitHub
boneskull/conjecture
Contribute to boneskull/conjecture development by creating an account on GitHub.
ThomasKientz commented 3 years ago

Same here, can reproduce the error with guessEmail directly.

tested under node 12, 13, 14.

gr2m commented 3 years ago

there was no recent change in conjecture or git-user-email. Maybe the output of a recent git version changed and it can no longer be parsed?

ThomasKientz commented 3 years ago

Issue is with path option https://github.com/boneskull/conjecture/blob/master/index.js#L19 it broke "git-user-email"

GitHub
boneskull/conjecture
Contribute to boneskull/conjecture development by creating an account on GitHub.
Chocrates commented 3 years ago

Is this confirmed? I have it on my list to make time tomorrow to test this.

ThomasKientz commented 3 years ago

@gr2m I have pinpointed the issue : https://github.com/jonschlinkert/git-user-email/pull/5

shaftoe commented 3 years ago

I can confirm this too, atm I can only reproduce it when building the current master head and invoking directly but not when run via npx

shaftoe commented 3 years ago

@Chocrates @ThomasKientz I can't reproduce this anymore, is still an issue for you or can we close this?

Chocrates commented 3 years ago

I can confirm @shaftoe, I was able to run npx create-probot-app bleh and use all the defaults, and the app created successfully.

ThomasKientz commented 3 years ago

@Chocrates you can close, it has been fixed in https://github.com/jonschlinkert/git-user-email/pull/5

Chocrates commented 3 years ago

Awesome! Closing. Thanks all for the quick RCA.