How to use SaveBar component from @shopify/app-bridge-react

I am trying to use the SaveBar component and imported it as follows:
import { useAppBridge, SaveBar } from '@shopify/app-bridge-react';
import { useAppBridge, SaveBar } from '@shopify/app-bridge-react';
However I get the following error:
SyntaxError: The requested module '/node_modules/.vite/deps/@shopify_app-bridge-react.js?v=855aef6d' does not provide an export named 'SaveBar'
SyntaxError: The requested module '/node_modules/.vite/deps/@shopify_app-bridge-react.js?v=855aef6d' does not provide an export named 'SaveBar'
This is weird cus i implemented this just today in the morning in a remix app outside of gadget and it worked fine. Please help me out;
5 Replies
Chocci_Milk
Chocci_Milk6mo ago
Hello, What version of @shopify/app-bridge-react are you using? You might have to upgrade the version.
safwan
safwanOP6mo ago
this is my package file: "@shopify/app-bridge-react": "4.0.0",
Chocci_Milk
Chocci_Milk6mo ago
Do you mind changing the package version to "^4.1.5" and rerunning yarn?
safwan
safwanOP6mo ago
for sure also I used the contextual save bar from polaris then which btw has a deprecated tag but worked fine for me, same for the toast component. Any idea why that could be happening? works now thanks a ton
Chocci_Milk
Chocci_Milk6mo ago
No problem!

Did you find this page helpful?