-
Notifications
You must be signed in to change notification settings - Fork 34
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
Axios upgrade breaks non-Node runtimes #127
Comments
@huw Do you have a patch for this? I'm trying to make one but struggling hard... |
@marcfrankel Been waiting on guidance from the maintainers, in the meantime |
@huw Version 2.1.2? That version doesn't seem to exist. Do you mean 3.1.2? |
Yep, was working from memory |
Hmm because i still get the error on that version:
|
I think in general my error is caused by the fetch failing but instead of rejecting in a serverless/edge environment it waits the full timeout and slows everything down. So far my best idea is just to recreate the base functionality I need directly using the API endpoints, but the fact no one has responded to you @huw in like two weeks is a super bad look for posthog. |
Ah the world of Node.js environments... Apologies for the delay in responding here. We're a small team doing our best to cover a wide range of issues. I'd like to make sure we capture this for good so we don't get caught out in the future. I'll try and get some sort of fix out asap hopefully with some sort of tests that could catch this. |
No complaints from me—maintaining an SDK for every language & runtime combo is tough work and non-Node is still pretty niche. Thanks for getting to it! |
@huw I don't suppose you have a simple way of reproducing this, short of deploying a full cloudflare worker...? |
Actually yes! You could:
(I was just talking about testing strategies here but re-reading your comment, if you want to just test a Worker in development you can use Wrangler for that) (I personally discovered this because I do (3) anyway for type correctness and my code refuses to compile) |
Just merged the change that should be a workaround for this issue (albeit not the end fix). Feel free to re-open if it is still an issue on the latest version |
@benjackwhite FYI, i've got this problem yesterday: #151 |
I also had this problem when trying to use posthog in supabase edge functions & trying to deploy it, downgrading to version 3.1.2 worked for me. |
This happens to me on posthog-node ^4.0.0. Downgrading to version 3.1.2 also worked for me.
|
Bug description
#122 breaks non-Node runtimes by introducing dependencies on Node internals which weren’t present in the previous version of Axios. This is because Axios v1 doesn’t provide the correct non-Node exports, which leads them to try and import a bunch of Node libraries, which they can’t.
A few potential fixes off the top of my head:
(I posted this as a comment on that PR but I’ve upgraded it to an issue so it doesn’t get lost)
The text was updated successfully, but these errors were encountered: