[Bug]: Checkout UI Extension - `shopify app dev` - Error: "Failed to Bundle Extension..."
Please confirm that you have:
- [x] Searched existing issues to see if your issue is a duplicate. (If you’ve found a duplicate issue, feel free to add additional information in a comment on it.)
- [x] Reproduced the issue in the latest CLI version.
In which of these areas are you experiencing a problem?
Extension
Expected behavior
Upon generating a Checkout UI Extension via shopify-cli, then running shopify app dev or npm run dev, the app should run locally and be served.
Actual behavior
- I am able to generate a Checkout UI Extension via
shopify-cli. - Upon running
shopify app devornpm run dev, the console does not serve the project and there is an error message. - This happens on a fresh scaffolded extension with default code from Shopify.
- This happens whether generating the Extension in a fresh App, or generating only the extension (no app).
- Shopify Remix App is able to run locally via
shopify app devornpm run dev, but once an Extension is generated, the app does not run and errors. - Shopify Plus support is not aware of a solution, and told me to open a issue here.
Verbose output
I do not want to post verbose output for security reasons. Verbose output shows all of the migrations and queries running for about 2 minutes, then it shuts down. Attached is a screenshot from verbose output.
The error message is as follows (upon shopify app dev):
Failed to bundle extension checkout-ui-extension. Please check the extension source code for errors.
Reproduction steps
- From the directory of your app, run
shopify app generate extension. - Select 'Checkout UI' as the Extension type.
- Run
shopify app dev. (This is where it fails for me).
Operating System
Ubuntu 24.04.1 LTS
Shopify CLI version (check your project's package.json if you're not sure)
@shopify/cli/3.66.1
Shell
Ubuntu 24.04.1 LTS Terminal Windows Subsystem
Node version (run node -v if you're not sure)
v18.20.4
What language and version are you using in your application?
TypeScript React
Hi @johnnativepath , I can't reproduce, can you try with shopify app build to see if you get the same error but with more information?
I was getting the same error in my Shopify project until I realized that I was importing some things from "@remix-run/node" in my checkout UI extension, which I guess doesn't work. Once I removed that, I stopped getting the error. Don't know if someone else will have this same issue, but this solved it for me.
If anyone comes looking for this bug with:
Failed to bundle extension YOUR_EXTENSION. Please check the extension source code for errors.
It could be caused by old shopify cli version and/or cache retainment:
npm install -g @shopify/cli@latest shopify cache clear