I’m building an Admin Shopify App using the Shopify Remix App Template, and I’m trying to deploy it to AWS using SST.
While everything works locally and remix vite:build
completes without errors, running sst deploy
throws the following error:
Error: Cannot require() ES Module /vite/dist/node/index.js in a cycle.
Error: Could not load Vite configuration from "vite.config.js". Check that your Remix project uses Vite and the file exists.
It seems this is due to an ESM conflict in SST.
The remix vite:build command runs without issues, but during sst deploy, it appears to call remix vite:build again internally, which causes the problem when loading the Vite config.
I attempted to switch to remix build without Vite, but then encountered the following error:
✘ [ERROR] Expected ";" but found "with"
node_modules/@shopify/shopify-app-remix/dist/esm/react/components/AppProvider/AppProvider.mjs:3:59:
3 │ ...I18n from '@shopify/polaris/locales/en.json' with { type: 'json' };
This seems to be caused by esbuild not supporting import assertions.
So here’s my question:
Is there a proper way to deploy the Shopify Remix app template to AWS?
Even when following SST’s own Remix guide, this Vite-related conflict still occurs.
Is it fundamentally impossible to deploy the Remix + Vite setup with SST?
All of my infrastructure is on AWS, so I’d like to establish a deployment process that stays within the AWS ecosystem.
For other REST APIs, I’ve been using the Serverless Framework and Lambda,
but I couldn’t find much documentation around deploying Remix apps in this context.
I’d like to know how other developers are handling deployment for this stack.
Thanks in advance.