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.
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!
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.
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.