Developers are encountering difficulties deploying Shopify Remix apps to Cloudflare Workers and Vercel, primarily receiving Error forwarding web request: AggregateError when following existing tutorials. The main challenge stems from incompatibility between Shopify’s Vite-based template and older deployment guides.
Key Solutions Identified:
Cloudflare deployment: One user successfully created a working template using D1 database with automated CI/CD deployment via GitHub (gruntlord6’s repo). Another tutorial covers adapting the official Shopify Remix template for Cloudflare Workers.
Vercel deployment: Requires disabling “Vercel Authentication” in deployment protection settings to prevent 401 errors from iframe requests. Database location and message file bundling (using dynamic imports instead of file system reads) also need special handling.
Development Workflow Limitation:
A significant constraint is the inability to use Shopify’s live preview tunneling (shopify app dev) with cloud deployments. The recommended workaround is maintaining a separate “appname-dev” deployment for testing changes before pushing to production, relying on Git-based CI/CD rather than local hot-reload development within the Shopify admin panel.
Summarized with AI on October 27.
AI used: claude-sonnet-4-5-20250929.
It’s really frustrating, but we’re still actively searching for a solution. As soon as we find something, we’ll share it here. Are you only experiencing the error locally, or does it also occur when you deploy?"
Hey,
Facing the same issue…
I was following the same tutorial.
Since the Shopify Template comes with vite, I am not certain if one can follow that tutorial step by step.
I tried to adapt as much of the code as I could to make it work with vite.
But eventually I ran into the same error that you are facing,
I also tried to run the repository that is linked below the article that you and I followed, but even that did not work out…
If you like, we can try to work together or exchange some knowledge to solve that issue.
I am in this Shopify community and some taken these steps to make it work
I deployed it successfully on CloudFlare Pages, it's bit tricky but works well now.
I tried to adapt project generated with Shopify cli but unsuccessful for some reason.
My steps were:
- setup remix app
- add shopify packages (bridge, cli, etc)
- implement oauth with kv, bridge, routing, etc.
- change from node to cloudflare where needed
- adapt to use cloudflare context env
They said they are working on making it open source as well so let’s see what’s gonna happen
I ran into similar issues hosting a Shopify Embedded app (using Remix/Vite) on Vercel.
401 on embedded app auth
It turns out the default ‘Vercel authentication’ setting issues a 401 response to any request coming from a iframe. Frustratingly, it also then does not log the request in Vercel, which made debugging tricky.
Thankfully, you can turn it off and after that it all worked:
For those coming to this afresh, worth thinking about where your database is going to be hosted. I was getting timeout errors because Vercel couldn’t access my DigitalOcean (DO) Postgres instance. DO only support external allowlisting using IP addresses (internally can use Droplet/K8S cluster etc.) but Vercel don’t publish a list/CIDR block of their Serverless Function IP addressses. That means I would have to make the DB publicly accessible, and just rely on credential security, or migrate to Vercel Postgres (now Neon Postgres). None of it is insurmoutable, just needs thought.
Messages file bundling
Vite (rollup) needs some help to find external message files. This didn’t work:
Nope, messed with it for a while and decided to just use a traditional vps with docker to manage the front end and leave the back end to cloudflare workers
Ok, so I had no luck with this for the longest time, but based on both increased experience with Cloudflare/Shopify and updates to both the Cloudflare Remix starter and the Shopify starter I was able to make it work.
So the deployment works fine, but how do I run it on preview through the cloudflare tunnels (shopify app dev) to have a dev preview running on shopify admin panel?
You don’t, you can do your local dev in the regular shopify app starter if you are looking for real time development with Vite. Cloudflare does have vite support but its not the same process as shopify uses for “shopify app dev” so it would not have the tunnel setup and thus wouldn’t work in the app bridge admin page.
If you just want a way to test the deployment in the cloudflare environment you can just make a second app deployment as a dev environment and test changes there before making them in your regular application.
I didn’t understand, so there is no way to have both worlds? live preview running inside shopify admin panel while developing and have it deployed in cloudflare for production?
I don’t understand how I should test my app while developing before actually deploying it..
Make a second app called “appname-dev” and deploy that. Use that for testing. When you are ready to deploy code, push it to your actual app “appname”.
You can’t test a cloud environment in vite using the shopify cli, they don’t have any support for that. They would need to add support for it as its not something I or anyone else has control over.
Ok I understood that part, but that would still need me to everytime I make a change to my app I need to run “remix vite:build && wrangler deploy” there is no actually live reload right?