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 'type') #74

Merged
merged 1 commit into from
May 25, 2024

Conversation

robingenz
Copy link
Contributor

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 'type')
    at file:///home/runner/work/static/static/node_modules/sponsorkit/dist/shared/sponsorkit.ccaa557f.mjs:1055:37
    at Array.map (<anonymous>)
    at fetchPolarSponsors (file:///home/runner/work/static/static/node_modules/sponsorkit/dist/shared/sponsorkit.ccaa557f.mjs:1048: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.

It seems like subscription_tier was an internal property which has just been removed. This is the API documentation: https://api.polar.sh/redoc#tag/subscriptions/operation/subscriptions:search_subscriptions

Linked Issues

Additional context

@birkjernstrom
Copy link

Wow fantastic work & quick catch @robingenz ! Sorry about this causing a breaking implementation.

We're introducing products soon and have consolidated subscriptions & products into one entity with different prices/intervals. I apologies for the breaking change. We're making some big investments into our API in the coming months(s) as we're expanding our product towards a v1.0 this year. Later, we'll definitely introduce versioning to avoid breaking changes causing actual breakages immediately.

@robingenz
Copy link
Contributor Author

@antfu It would be great if we could merge this quick fix.

@antfu antfu merged commit 0f2b6ed into antfu-collective:main May 25, 2024
1 check failed
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.

None yet

3 participants