For discussing the development and usage of Checkout UI extensions, post-purchase extensions, web pixels, Customer Accounts UI extensions, and POS UI extensions
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.
Maybe someone has already encountered such a problem. Tell me the solution if you know, please.
Solved! Go to the solution
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.
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.
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!