I'm just testing an action and keep
I'm just testing an action and keep getting this error:
The action calls a 3rd party API and returns an array of objects. Has anyone come across this type of error before? I just tested running the API call in Postman multiple times and it always runs without any issues so I'm not sure why it's an issue when called from the action.
3 Replies
It's a little weird as it looks like the API call is being rate limited, as if I wait 30s and try again it succeeds, but then fails immediately if I try again straight away.
However, if I use Thunder Client in VS Code and hit the endpoint multiple times it never fails, so I'm not sure what's going on right now.
Hmm, I just added
"use node"
in my action file and the API calls are now fine. I was stumped by this as it states in the docs that fetch()
is supported in the Convex environment so I didn't think the environment was the issue here.
I'd appreciate a comment from anyone with more experience than me with Convex why this might be the case and why fetch()
is throwing rate limiting type errors for me unless I switch to the "use node"
environment. 🙂Hmm it sounds like we might have an issue in our fetch implementation (which is why "use node" is working).
Would you be able to share more of the code you're running in your action to help me reproduce? (feel free to DM if you don't want to share here)
Thanks. DM sent. 🙂