Dev env working well, production env not working. Possible CORS error?
Hey guys, I am having the strange behaviour where my dev env code is working but my production isn't. I am using gadget as a middle man for my voiceflow chatbot. So messages sent from the chatbot ui on the storefront get sent to the gadget endpoint which talks to the voiceflow API we send that back.
This all works fine in the dev env, but not in the production.
What's weird is that you send the message, and in the logs it says 'incoming request', then 2 minutes later in the console it wil say: 'from origin 'https://www.sherpapower.co.uk' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.'
But then it actually goes through to voiceflow, but takes ages....
Yet in our dev env it works perfectly fine, no CORS error and no long wait. Even though it's the exact same code, any idea why this could be?