CLI hot reloading theme app extension

Can anyone point me in the right direction to get hot reloading working for theme app extensions in the Shopify CLI?

  • “shopify app generate extension” to create extension
  • “shopify app dev” which loads a preview URL

Now what? The preview URL just links to the backend

Each time I save code, I see:

“extensions │ Draft updated successfully for extension: [extension-name]” in the terminal

Hey James,

If you navigate to the theme editor in the store admin, you should able to see your app extension appearing as a pickable block, along with the latest changes you’ve made.

I’m not 100% sure if fully hot reloading will work when you make changes - you may need to make a change, save and manually re-load the editor to see the change you just made.

1 Like

Hi! Hot reloading should work for theme app extensions. You just need to follow the steps here: Build theme app extensions

After making a change in the code, it should be automatically updated in your local preview.

2 Likes

Thanks everyone! I’ve been building the embedded part of the app for a while now and completely overlooked the new output in the terminal - where the preview URL for the theme app extension was different to the embedded app.

1 Like

Is anyone still experiencing issues with HMR when working locally and modifying extension code? It was working in earlier CLI versions but no longer functions in the latest 3.76.2, which I’m currently using. Changes are no longer reflecting, and the console isn’t showing any updates. Previously, the terminal displayed the message:

“extensions │ Draft updated successfully for extension: [extension-name]”

but I’m not seeing this anymore. For reference, I’m using the default “extensions/” folder for extension code, so there’s no need to set extensions_directories in the app.toml config file.

I’m also not seeing changes to an app block reflected in the localhost preview, even though I am seeing HotReload messages in the console:

I can only see changes if I reload the page manually.