Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug: Crash looking up packages for some maintainers: Cannot read properties of undefined (reading 'map') #277

Closed
3 tasks done
JoshuaKGoldberg opened this issue Nov 28, 2024 · 3 comments · Fixed by #278
Labels
status: accepting prs Please, send a pull request to resolve this! 🙏 type: bug Something isn't working :( 🐛

Comments

@JoshuaKGoldberg
Copy link
Owner

Bug Report Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have pulled the latest main branch of the repository.
  • I have searched for related issues and found none that matched my issue.

Expected

npx tidelift-me-up --username sboudrias should retrieve data normally.

Actual

npx tidelift-me-up --username sboudrias
file:///Users/josh/.npm/_npx/3874edfee03e1fcc/node_modules/npm-username-to-packages/lib/npmUsernameToPackages.js:11
    packages.push(...body.objects.map((result) => result.package));
                                  ^

TypeError: Cannot read properties of undefined (reading 'map')
    at npmUsernameToPackages (file:///Users/josh/.npm/_npx/3874edfee03e1fcc/node_modules/npm-username-to-packages/lib/npmUsernameToPackages.js:11:35)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async tideliftMeUp (file:///Users/josh/.npm/_npx/3874edfee03e1fcc/node_modules/tidelift-me-up/lib/tideliftMeUp.js:16:27)
    at async tideliftMeUpCli (file:///Users/josh/.npm/_npx/3874edfee03e1fcc/node_modules/tidelift-me-up/lib/cli/tideliftMeUpCli.js:47:28)
    at async file:///Users/josh/.npm/_npx/3874edfee03e1fcc/node_modules/tidelift-me-up/bin/index.js:4:1

Node.js v22.4.1

Additional Info

No response

@JoshuaKGoldberg JoshuaKGoldberg added status: accepting prs Please, send a pull request to resolve this! 🙏 type: bug Something isn't working :( 🐛 labels Nov 28, 2024
@JoshuaKGoldberg JoshuaKGoldberg transferred this issue from JoshuaKGoldberg/tidelift-me-up Nov 28, 2024
@JoshuaKGoldberg
Copy link
Owner Author

Adding a console.log({ body }):

 $ node test.js
{ body: { error: 'Service Unavailable' } }
file:///Users/josh/repos/npm-username-to-packages/lib/npmUsernameToPackages.js:12
    packages.push(...body.objects.map((result) => result.package));

Huh.

@JoshuaKGoldberg
Copy link
Owner Author

@all-contributors please add @JoshuaKGoldberg for bug.

🤖 Beep boop! This comment was added automatically by all-contributors-auto-action.
Not all contributions can be detected from Git & GitHub alone. Please comment any missing contribution types this bot missed.
...and of course, thank you for contributing! 💙

Copy link

@JoshuaKGoldberg

I've put up a pull request to add @JoshuaKGoldberg! 🎉

JoshuaKGoldberg pushed a commit that referenced this issue Nov 28, 2024
Adds @JoshuaKGoldberg as a contributor for bug.

This was requested by JoshuaKGoldberg [in this
comment](#277 (comment))

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepting prs Please, send a pull request to resolve this! 🙏 type: bug Something isn't working :( 🐛
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant