Preview is not loading

Hey - I'm trying to preview stores with the app installed but it doesn't load because the shopcontext.jsx and hostcontext.jsx doesn't seem to work inside the embedded preview. Same in development as and in production. Works fine on other stores using react context providers for hooks in the templates. Once I tried using a useFindFirst for the embeddedApp in app.jsx but then it just complained about host not being provided (in the index.jsx loading after loading app.jsx). I don't want to have to refactor the app since I like having the context providers. What can I do?
No description
No description
5 Replies
thore cardel
thore cardelOP2mo ago
App is "themeflow"
[Gadget] Kyle
[Gadget] Kyle2mo ago
useShop is a shopify hook? the preview in the editor uses a mock shopify app bridge so anything that requires the real shopify app bridge will not work
thore cardel
thore cardelOP2mo ago
Okay, no its not a Shopify hook but a context provider that uses usefindone inside it. So it should work if all the gadget hooks are supported in this view.
[Gadget] Kyle
[Gadget] Kyle2mo ago
Yes all gadget hooks work in the preview
thore cardel
thore cardelOP2mo ago
Hmm then it would be good if you can check what’s going on because it should work then

Did you find this page helpful?