Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Shopify pos ui extension - Error loading extension

Solved

Shopify pos ui extension - Error loading extension

turarbek
Shopify Partner
5 1 0

Here is my package.json file:

 

{
  "name": "pos-ui-extension-discounts",
  "private": true,
  "version": "1.0.1",
  "license": "UNLICENSED",
  "dependencies": {
    "@shopify/retail-ui-extensions": "1.5.0",
    "@shopify/retail-ui-extensions-react": "1.5.0",
    "react": "^17.0.0"
  },
  "devDependencies": {
    "@types/react": "^17.0.0"
  }
}

 


and here is my shopify.ui.extension.toml file.

 

 

type = "pos_ui_extension"
name = "Active discounts"
description = "Active discounts"
handle = "pos-ui-extension-discounts"

extension_points = [
  'pos.home.tile.render',
  'pos.home.modal.render'
]

[capabilities]
network_access = true

 

It seems like I did everything correctly according to the documentation. But i get the following error when adding tile to SmartGrid. 

photo_2024-04-30_14-22-38.jpg

 

Maybe someone has already encountered such a problem. Tell me the solution if you know, please.

Accepted Solution (1)

turarbek
Shopify Partner
5 1 0

This is an accepted solution.

We managed to fix the error. The problem was with the specified version of react. I changed the react version to 18.2.0 and everything started working. Before this, it worked without errors, even when "^17.0.0" was specified. Apparently something has changed on the Shopify side.

View solution in original post

Replies 2 (2)

turarbek
Shopify Partner
5 1 0

This is an accepted solution.

We managed to fix the error. The problem was with the specified version of react. I changed the react version to 18.2.0 and everything started working. Before this, it worked without errors, even when "^17.0.0" was specified. Apparently something has changed on the Shopify side.

alexlod
Shopify Partner
4 1 1

Can you walk me through how you changed the version? I know how to change `package.json` but I can't figure out how to get the `shopify` CLI to build with that new dependency. I tried deleting the `dist` folder and restarting `shopify app dev`. `dist` got recreated but still shows React version `17.0.2` as a dependency. Thanks!