Shopify CLI Migration Gotcha: Fixing Theme App Extension UID Errors
Uh Oh! Theme App Extension UID Errors After Shopify CLI Migration? You're Not Alone!
Migrating to the latest Shopify CLI can be a real game-changer, unlocking new features and streamlining your development workflow. But sometimes, things don't go quite as planned. I was just reading a thread in the Shopify Community where @yomeyers ran into a tricky "Theme App Extension UID Error" after migrating. It seems they weren't alone, and the solutions are pretty insightful, so I wanted to share what I learned.
The Problem: UID Errors Blocking Development
So, @yomeyers was migrating an app built with CLI 2 to the latest version to take advantage of POS extensions. After following the migration instructions, running shopify app dev threw this error:
╭─ error ──────────────────────────────────────────────────────────╮
│ Your app has extensions which need to be assigned `uid` │
│ identifiers. │
╰──────────────────────────────────────────────────────────────────╯
Frustrating, right? Especially since production deployments were working fine! They were stuck because shopify app dev was failing, blocking them from testing and debugging new features. They had already tried a few things:
- Successfully deployed to production (
shopify app deploy) - Verified all
shopify.extension.tomlfiles contained UIDs - Manually added the original extension UUID (from their old
.envfile) for their legacy theme-app-extension.
Despite all that, the error persisted in dev mode. Here are the screenshots @yomeyers shared:


The Solution: A Fresh Start (Sometimes!)
Thankfully, @youssefhe5 chimed in with a suggestion based on a similar issue they had faced. Their solution? Deleting the .shopify folder and re-running shopify app dev.
Here's the suggested approach from youssefhe5:
- Delete the
.shopifyfolder in your app directory. - Run
shopify app devin your console. - Go through the steps to set up your project again (choosing your store, etc.).
This essentially resets the development environment, forcing the CLI to re-establish the connection with your app and extensions. It's like giving your development setup a clean slate.
Why This Works (and When It Might Not)
The .shopify folder stores important configuration details about your app and its connection to your Shopify store. Sometimes, after a migration, these cached settings can become outdated or corrupted, leading to unexpected errors like the UID issue. Deleting the folder forces the CLI to regenerate these files with the correct, updated information.
Now, while this worked for @youssefhe5, it's important to note that it might not be a universal fix. If you've made significant manual changes to your app's configuration or if the problem lies deeper within your extension code, this might not resolve the issue. However, it's definitely a quick and easy first step to try!
Other Things to Check
If deleting the .shopify folder doesn't do the trick, here are a few other things to double-check, based on the original poster's troubleshooting steps:
- Verify UIDs in
shopify.extension.toml: Double, triple-check that all your extensions have valid, unique UIDs in their respectiveshopify.extension.tomlfiles. A missing or incorrect UID is the most likely culprit. - Extension UUID: Manually add the original extension UUID (from your old
.envfile) to prevent merchant data loss. - Shopify CLI Version: Ensure you're running the latest version of the Shopify CLI. Outdated versions can sometimes have compatibility issues. Run
shopify versionto check andshopify upgradeto update.
Migrating can be a bit bumpy sometimes, but the Shopify community is a fantastic resource for troubleshooting. Hopefully, this helps you resolve those pesky UID errors and get back to building awesome apps!