You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We set up some serverless functions following the example from this repo, but when I test a React module that uses one of our serverless functions locally via npm start, it always seems to receive a 200 OK status code even when the serverless function returns a 400 or 404.
You can see in the serverless logs that it's returning the correct status code:
But I always receive a 200 status code locally:
Based on the output in my terminal, it looks like these requests are running through a proxy:
attempting to proxy a POST serverless request to domain: 46512223.hs-sites.com for resource: /hs/serverless/create-user ...
I'm guessing that the proxy is just incorrectly converting everything to 200 for some reason. This makes building error handling for specific status codes very difficult, as I can't test the results locally. Even when I use the http://hslocal.net:3000/proxy?page= approach using a published page that includes my module, the same issue occurs.
The only way I can test status codes currently is if I deploy everything to Hubspot, but that's a super clunky DX.
Hoping someone can help! Thanks!!
The text was updated successfully, but these errors were encountered:
We set up some serverless functions following the example from this repo, but when I test a React module that uses one of our serverless functions locally via
npm start
, it always seems to receive a200 OK
status code even when the serverless function returns a400
or404
.You can see in the serverless logs that it's returning the correct status code:
But I always receive a
200
status code locally:Based on the output in my terminal, it looks like these requests are running through a proxy:
I'm guessing that the proxy is just incorrectly converting everything to 200 for some reason. This makes building error handling for specific status codes very difficult, as I can't test the results locally. Even when I use the
http://hslocal.net:3000/proxy?page=
approach using a published page that includes my module, the same issue occurs.The only way I can test status codes currently is if I deploy everything to Hubspot, but that's a super clunky DX.
Hoping someone can help! Thanks!!
The text was updated successfully, but these errors were encountered: