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

fix(polar): Cannot read properties of undefined (reading 'price') #69

Merged
merged 1 commit into from
May 12, 2024

Conversation

robingenz
Copy link
Contributor

@robingenz robingenz commented May 11, 2024

Description

The following error message appears when I retrieve sponsorships from Polar (see this run):

[info] Fetching sponsorships from polar...
TypeError: Cannot read properties of undefined (reading 'price')
    at file:///home/runner/work/static/static/node_modules/sponsorkit/dist/shared/sponsorkit.d376c786.mjs:1047:51
    at Array.map (<anonymous>)
    at fetchPolarSponsors (file:///home/runner/work/static/static/node_modules/sponsorkit/dist/shared/sponsorkit.d376c786.mjs:1030:53)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async run (file:///home/runner/work/static/static/node_modules/sponsorkit/dist/cli.mjs:143:22)
    at async Object.handler (file:///home/runner/work/static/static/node_modules/sponsorkit/dist/cli.mjs:367:5)
Error: Process completed with exit code 1.

According to the API documentation, there is no subscription property in the response. Instead, the price property is at the top level.

Linked Issues

There was already a fix recently (see #67), but it doesn't seem to have helped. @Julien-R44 Have you tested your changes? Is it currently working for you?

Additional context

@robingenz robingenz changed the title fix(polar): Cannot read properties of undefined fix(polar): Cannot read properties of undefined (reading 'price') May 11, 2024
@Julien-R44
Copy link
Contributor

Julien-R44 commented May 11, 2024

Aaaah shit, sorry, not sure what I had in mind when I did the fix 😅
It's indeed sub.price and not sub.subscription.price. Sorry

@robingenz
Copy link
Contributor Author

@Julien-R44 Thank you for taking a look!

@antfu antfu merged commit 96428e2 into antfu-collective:main May 12, 2024
1 check passed
StarHeartHunt pushed a commit to MooncellWiki/sponsorkit that referenced this pull request May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants