I'm in the process of developing my very first Shopify app. The primary function of my app is to present a post-purchase survey to customers using the Checkout UI Extension. The questions for the survey are dynamically fetched from an API, and once customers complete the survey and click "Submit feedback," the responses are sent to an external backend. I've utilized the fetch() method to manage these data requests.
This works just fine when I run it locally (npm run dev), but after I deploy my app to fly.io (following this guide), I can't get the survey to show.
In development mode, I can see in the Networks tab that a request is made to my app URL (https://[shopify-generated-URL].trycloudflare.com/extensions) when the order status page loads. This doesn't happen in when I change my app URL and App redirect URL to match my fly.io credentials.
What I've done so far:
What am I missing?🤔 Despite my best efforts, I'm still unable to solve this problem and it has me puzzled. I've dedicated a lot of time to troubleshooting but seem to be stuck. Any assistance or insights you can offer would be greatly appreciated. Many thanks in advance!
It's great to hear that you're developing your first Shopify app, so let's look into why this deploym ent issue might be happening.
At first glance, it seems like there could be a couple of different issues at play:
CORS: This is a common issue when trying to fetch data from a different domain, which is the case when your app is running on fly.io and trying to fetch data from Shopify. You might want to check your server's CORS settings and make sure that Shopify's domain is in the allowed origins.
SSL Certificate: When you move from a local development environment to a live site, you need to ensure that your site is served over HTTPS. For this, you need an SSL certificate. Fly.io usually handles this for you, but you might want to check if there were any issues in this process.
Shopify App Bridge: Shopify uses App Bridge for embedding apps within the Shopify admin. It's possible that there might be some configuration issues with App Bridge that are preventing your app from working properly after deployment.
Check your server logs: If there's an issue with your server or your app, the error logs could give you more information about what's going wrong. You can access these logs through your hosting platform (fly.io).
Check your extension's deployment status: Make sure to check the status of your extension's deployment in your Partner Dashboard. It's possible that there might have been an issue with the deployment process.
Try the above and let us know if you're still seeing issues!
Hello, and thanks for your reply Liam!
I followed your list and can verify steps 2, 4, and 5. I couldn't find anything on CORS in fly.io's documentation or forum and I see no CORS errors in their logs or my browser console. I do however see this privacy_access_token. Also, in my network tab, I see no signs of Shopify trying to communicate with my app on fly.io. When in development mode, I can clearly see a request being sent to my app URL's extension folder.
To simplify things, I also tried to create a new app with a checkout UI extension that just displayed a banner saying "hello from fly.io", but that didn't work either.
Any thoughts on how to progress are much appreciated!