Get "Expected a valid shop query parameter" when I switch between pages in my App

Loop_subscribe
Tourist
6 0 5

Hello,

I have created a simple app that has a few pages in it and nothing else. When I switch between the pages I get "Expected a valid shop query parameter" in the page body instead of the actual content. 

Any idea what maybe causing this?

Thanks,
Akhil

Replies 6 (6)

lucasharvey
Tourist
5 0 6

I'm also experiencing this issue when switching between pages using the navigation bar.

Loop_subscribe
Tourist
6 0 5

Hi, relieved to know that someone else is also facing the issue. Because it looks like there are not much resources online available on this. Please do let me know if you get any resolution or workaround 🙂 Thanks!

jam_chan
Shopify Partner
891 23 171

Requests sent by Shopify will have a shop parameter attached. if the requests are not sent by Shopify, the parameter is not available. The docs do include this information. 

I think you should post the thread to API or another developer-related board. This board is not that related. 

BYOB - Build Your Own Bundles, SPO - SEO App to research keywords & edit social link preview
Loop_subscribe
Tourist
6 0 5

I am getting this error as part of creating app using the shopify app cli and following this for adding navigation in embedded app https://shopify.dev/tutorials/create-a-navigation-link-with-app-extensions?locale=en

mxxm
Shopify Partner
13 0 3

I am facing the same issue. Did you find a solution on how to solve this?

lucasharvey
Tourist
5 0 6

In my case the issue was that "npm run dev" was not building the pages ahead of time before they are requested. Since the page wasn't built into a static file served to the browser, the App frontend was hitting the backend to get the page, but it was not authenticated. To fix this, instead of "npm run dev", I now run "npm run build && npm run start". This builds all the pages ahead of time. While it does take more time, I no longer get the "Expected a valid shop query parameter" error.