-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ensureInstalledOnShop
did not receive a shop query argument
#161
Comments
ensureInstalledOnShop
did not receive a shop query argument
Same issue after running the CLI app template. Shop is passed at first, then disappears. Logs:
App then terminates to a blank page. |
I'm having the same issue on requests made from the embedded app. |
Can't deploy right now, is not loading properly. |
Why is this issue not getting any attention? This has been an issue since January - #94 Apps are getting rejected in the review process for this issue. Can't even downgrade to an older version, since alot of the new version of other session packages are not compaitable/having issues. |
Same. Logs: |
I am getting the same error, has anyone already found a solution for it?
|
Pining @mkevinosullivan and @paulomarg to get any info on this? |
Requests for static files will still generate |
I also seem to be receiving the error |
Any movement? |
I was able to fix this. Unfortunately, it took deleting the app, starting from the current CLI app template, and taking about a week to put my previous app (based on their old template) into the new template and very painfully convert it again to typescript. Huge pain, but works now. Old version used next, new version uses express. This is after the app was delisted due to breaking changes Shopify made that I did not seem to be made aware of. |
I'm having this issue on an app that I created from the CLI app template just earlier this year, so does not seem like the solution to this issue. It seems like the requests sent from the frontend app is missing the shop query parameter from url's and thus the ensureInstalledonShop middleware fails. |
Dear Developers, @mkevinosullivan @cquemin @paulomarg @refactor-this @teddyhwang @ajshepley I am writing to bring to your attention a critical issue that is affecting the performance of the Shopify apps developed using your library. As you may already be aware, there is a bug in your code that needs immediate attention. This issue has caused inconvenience and loss of revenue for many businesses, including small companies and individual developers like myself, who rely on your library to build applications. It is not only frustrating but also damages the reputation of our companies and the trust of our users. I understand that fixing bugs can be a challenging and time-consuming task. However, I implore you to prioritize this issue and provide a resolution as soon as possible. If a quick fix is not feasible, it would be appreciated if you could suggest a temporary solution or workaround to mitigate the impact of the bug on our applications. I am confident that you will address this problem promptly and efficiently, and I appreciate your efforts in ensuring that your library provides a reliable and stable foundation for the development of Shopify apps. Thank you for your attention to this matter. Sincerely, |
I found an explanation for this. There's a good chance that it is happening because you did not set up your Express Routes properly. Look at this post for an explanation of how to set them up properly, and why you would receive these errors from -- If the above does not apply to you, here's a fix to add the This fix is with a Shopify app created from Shopify-CLI 3.45.1. That generates an app with an Express Server backend and a React frontend. I'm sure many people reading this thread have done the same. Using this app, which includes the My FixI added some middleware to my Express Server app, to add the
The Result
Next, it complains about missing a Disclaimers
|
Shopify please solve this |
@xegulon did my steps in the above post work for you? Either checking your routes, or the fix? |
@bashunaimiroy I have the problem with the exact template I got from My app is deployed in an Amazon EBS environment When I try to install the app for testing on my dev store, I have endless |
@xegulon Could you clarify, is this happening immediately after you click "Install"? And if so, what's the path of the request that is causing this error? Is it one of these: If that's the case, then it would be good to look in
And that you're using them in your server code, as per here. If you've created your app from the Shopify CLI as you mentioned, then everything should be fine- what I mentioned are the default setting values. If on the other hand these errors are happening in response to another request, like one that your app is making from its frontend, then you may have to carefully debug to make sure that your server is properly responding to the request, as I outlined in my answer above. Good luck! |
I'm not sure if this bit of info is going to be applicable to your particular issue with ensureInstalledOnShop not receiving a shop param but in my application I was having the same issue and I fixed it by reordering the imports. When I was getting the error in regards to the shop param missing I had a static asset being imported prior to the useAuthenticatedFetch import, once I moved the import for my static asset after the useAuthenticatedFetch import it began working. Using imports in this order cause the error to occur in my app
After reordering the imports, the error ceased
|
Start the frontend project with Vite during development to solve this problem. |
Dear @bashunaimiroy, I would like to express my sincere gratitude for providing me with the clarification. Your insight has been instrumental in helping me comprehend the direction of the error. I attempted to implement the solution you proposed, but unfortunately, it did not yield the desired results. If it's not too much trouble, could you kindly spare some time to take a look at this post? Perhaps I overlooked something, and your expertise could assist me in resolving the issue. Thank you for your assistance and ongoing support. I've added Here is index.js
And Here is LOGS from server:
|
I found a lot of such error logs in the production environment, please solve this problem as soon as possible |
@bashunaimiroy thank you very much, your solution approach has solved the problem |
I also have the same issue. The shop query is present on OAuth but disappears as soon as the grant screen process is completed. |
@ArasHuseyin but does it work when you try to install the app? If I don't include ensureInstalledShop it won't get the merchant to Grant screen. |
Another thing I noticed is that when it's used on an endpoint it works fine.
Only when used as middleware it throws and error. |
yes it does work when i install the app |
For me I have a weirder log
This is just me duplicate the query to another component. Call API and it return "No shop provided" in response |
Also been running into the error "ensureInstalledOnShop did not receive a shop query argument | {shop: :undefined}". Currently using the node.js template with redis session storage. Edit - Solution for us: We found a solution for ourselves and putting it here in case it helps anyone else. Our setup was the node.js app with the Redis adapter on Heroku. We switched from the Redis adapter to the MySQL adapter and we stopped getting that error. |
I have the same issue when deploying an app on the server, Here is the workaround which works for me: Just add I have also add some other environment variables on the root directory (also in web folder):
|
I do not know how, but NODE_ENV=production fixed the issue.
|
is it because the NODE_ENV determine the STATIC_PATH in const STATIC_PATH =
process.env.NODE_ENV === "production"
? `${process.cwd()}/frontend/dist`
: `${process.cwd()}/frontend/`; |
@umutsesen Let me add my understanding on why it works with
when we run But when we run it on the server we run our you can see here for production our |
I got this error again if I make a programmaticaly redirect to the |
Saw this for a minute this morning while playing around with a proof of concept app. Surprised this issue is still open, but for my case, I just had mismatched post/get methods. Calling the api like this:
With the endpoint set up like this:
Fixing the mismatched get/post fixed it for me ( |
In this case, I did not notice that the middleware function was not called. I replaced // Auth
app.get(shopify.config.auth.path, shopify.auth.begin());
app.get(
shopify.config.auth.callbackPath,
shopify.auth.callback(),
) However, you need to keep in mind that you still need a custom fetch function, exitFrame, etc. It would be useful to explain this more explicitly in the documentation. |
My custom embedded app made using the latest Node example (I just switched "useOnlineTokens to true") is unable to create a new session token when opened from the official Shopify mobile app both on Android and iOS. So the users of the app have to first visit the app from a browser and only then can they use my app from the Shopify app. I also saw the error mentioned in this task in the console so I hope it is the cause of my issue as well. |
Any update? |
Ok, we had the same issue. We upgraded all of our packages and tried almost everything and nothing worked. We were prepared to add a rule to our CloudWatch to ignore this error. Before that, I decided to do a final investigation on this. I first looked for the place where this error is being logged and that is here. As you can see there is the condition And we got very unexpected results. The requests that caused this problem were very random! We don't know what exactly are these, these can be bots or attacks on merchant stores, but anyway, this had to be taken care of. How we took care of this problem was to have a '/home' page (for us instead of index.jsx) and append '/home' to App URL on the App setup and finally change the '/*' to '/home/*' for And this got rid of our problem. |
If you send a request to a non-existent endpoint, this error is also triggered. For instance, due to a typo, I spent 3 hours troubleshooting. The correct endpoint is /api/sizecharts/save |
This issue is stale because it has been open for 90 days with no activity. It will be closed if no further action occurs in 14 days. |
not stale |
We're labeling this issue as stale because there hasn't been any activity on it for 60 days. While the issue will stay open and we hope to resolve it, this helps us prioritize community requests. You can add a comment to remove the label if it's still relevant, and we can re-evaluate it. |
Still an issue for us. We've never had any problems with auth when testing ourselves (on multiple stores, accounts, browsers, etc). The reviewer added screen recordings of typical auth failures and our log contains
But we can't reproduce it :/ |
For anyone who runs into this issue even with the recent CLI / Express package fixes, make sure you check your build process and/or Dockerfile and ensure you're setting |
@curiouscrusher Hey there, I've added
Here are my logs:
|
We're labeling this issue as stale because there hasn't been any activity on it for 60 days. While the issue will stay open and we hope to resolve it, this helps us prioritize community requests. You can add a comment to remove the label if it's still relevant, and we can re-evaluate it. |
not stale |
Not stale |
Same Error: |
why you guys are not resolving ? Time to escalate to upper management ? ah |
The issue really here is how we are setting up the proxy URL. If the proxy URL is messed up then it throws this error message. They are not specific on the error message. I did set up my proxy correctly and adjusted end points it started working. ex :- Proxu URL : https://tracy-roger-bruce-up.trycloudflare.com/storecall
So if you mess up the "My Frontend Proxy StoreFront URL" then it returns with "ensureInstalledOnShop" error.. |
Issue summary
During moderation in the Appstore, I have already received a reject several times. There are errors in the moderator's account when changing the subscription plan. I see in the production logs
ensureInstalledOnShop
did not receive a shop query argument. I can't figure out why this is happening. There is no such error on my dev/prod accounts, including test staff accounts.How can more data be collected when this happens? I thought the issue would be solved after closing #94, but these errors are again...
Packages:
@shopify/[email protected]
@shopify/[email protected]
@shopify/[email protected]
@shopify/[email protected]
node v18
Logs:
Shopify.ts
App.ts
The text was updated successfully, but these errors were encountered: