cli icon indicating copy to clipboard operation
cli copied to clipboard

[Bug]: Checkout UI Extension - `shopify app dev` - Error: "Failed to Bundle Extension..."

Open johnnativepath opened this issue 1 year ago • 1 comments

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

  1. I am able to generate a Checkout UI Extension via shopify-cli.
  2. Upon running shopify app dev or npm run dev, the console does not serve the project and there is an error message.
  3. This happens on a fresh scaffolded extension with default code from Shopify.
  4. This happens whether generating the Extension in a fresh App, or generating only the extension (no app).
  5. Shopify Remix App is able to run locally via shopify app dev or npm run dev, but once an Extension is generated, the app does not run and errors.
  6. 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.Image

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

  1. From the directory of your app, run shopify app generate extension.
  2. Select 'Checkout UI' as the Extension type.
  3. 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

johnnativepath avatar Sep 13 '24 18:09 johnnativepath

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?

isaacroldan avatar Sep 27 '24 13:09 isaacroldan

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.

GrantMickle21 avatar Dec 20 '24 02:12 GrantMickle21

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

prayge avatar Aug 13 '25 15:08 prayge