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!