posthog-js
posthog-js copied to clipboard
React SDK - Session Recorder - Original fetch args is modified causing application to crash
Bug description
We use the React SDK to initialize posthog. We have a fetch interceptor which modifies the request before the API call is made.
After integrating with posthog, the fetch API is already modified and the args are not passed properly, because of this our interceptor is not able to function properly. The issue is with the recorder.js file.
TLDR; you are modifying the original fetch and not forwarding all the args in this format ...args . And hence our fetch interceptor which expects two args, receive only one causing the app to crash.
How to reproduce
- Load react posthog
- modify the fetch API like
window.fetch = ... - App crashes
Please let me know, how to resolve this or what is the next step.
I'm attaching a screenshot of the recorder.js file for reference, where you are overriding the default fetch.
I have already sent an email, but was not able to track it.
Debug info
No response