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

chore: Upgrade axios dep #122

Merged
merged 2 commits into from
Oct 27, 2023
Merged

chore: Upgrade axios dep #122

merged 2 commits into from
Oct 27, 2023

Conversation

benjackwhite
Copy link
Collaborator

@benjackwhite benjackwhite commented Oct 27, 2023

Problem

Fixes #121

Changes

User mentioned our axios dep is somewhat outdated. The vulnerability mentioned shouldn't affect us given we only call our own endpoint, but nonetheless worth keeping up to date.

Release info Sub-libraries affected

Bump level

  • Major
  • Minor
  • Patch

Libraries affected

  • All of them
  • posthog-web
  • posthog-node
  • posthog-react-native

Testing

Tested locally with the example and all seemed fine

@benjackwhite benjackwhite marked this pull request as ready for review October 27, 2023 08:48
Copy link
Member

@pauldambra pauldambra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷

@benjackwhite benjackwhite merged commit 4b2f733 into master Oct 27, 2023
3 checks passed
@benjackwhite benjackwhite deleted the fix/axios-update branch October 27, 2023 09:23
@huw
Copy link

huw commented Oct 30, 2023

Ack! This breaks all non-Node runtimes (ex. Cloudflare) because Axios v1 doesn’t provide the correct non-Node ESM exports, which leads them to try and import a bunch of node modules, which they can’t.

A few potential fixes off the top of my head:

  1. Replace Axios with fetch (now that fetch is in all LTS versions, this might not be unreasonable; it would also mean non-Node runtimes don’t have to add fetch as a parameter when instantiating PostHog)
  2. Agitate Axios to fix Default exports for browser points to module that imports node modules axios/axios#5495
  3. Patch it
  4. Split the package into Node and non-Node in package.json#exports

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.

[posthog-node] Upgrade axios to 1.6.0
3 participants