App returns 302 to store if tried to install using "store"

App returns 302 to store if tried to install using "store"

catrawalkar
Shopify Partner
19 0 4

In my app, when I goto Partner Dashboard and Open App using "Test Your App" feature in dashboard, App opens fine.

 

But when I uninstall this app from store and reinstall using store, the app gives 404 error and in server logs, server is returning 302 status code.

 

How can I solve this?

catrawalkar@gmail.com
Replies 14 (14)

SomeUsernameHe
Shopify Partner
519 58 113

Are you using the Shopify Remix App Template? https://github.com/Shopify/shopify-app-template-remix

Have I helped? Consider putting coffee in my mouth!
Buy Me a Coffee
catrawalkar
Shopify Partner
19 0 4

Yes.

 

I am using this documentation: https://shopify.dev/docs/apps/getting-started/create and using this command: 

npm init @Shopify/app@latest

 Ultimately I belive it uses the https://github.com/Shopify/shopify-app-template-remix this template only.

catrawalkar@gmail.com
SomeUsernameHe
Shopify Partner
519 58 113

Can you still install your app by running "npm run dev' and pressing "p" to preview it? 

Have I helped? Consider putting coffee in my mouth!
Buy Me a Coffee
catrawalkar
Shopify Partner
19 0 4

Yes it does work.

 

Pl Note: I have kept "automatically_update_urls_on_dev=false" so it takes url of my server even if I have run "num run dev".

catrawalkar@gmail.com
fayazrafeek
Shopify Partner
2 0 2

Any solution to this? I'm also facing the same issue, the graphQl api call that was working fine till last day, suddenly returning 302 status code.

I'm using Remix template, and  "automatically_update_urls_on_dev=true"

catrawalkar
Shopify Partner
19 0 4

Hi @fayazrafeek Can you post a screencast of this ? will be helpful..

catrawalkar@gmail.com
921Kiyo
Shopify Partner
19 0 3

I have the same issue, getting 302 redirect on the client followed by login auth 404 failure. How did you manage to fix 302 status code?

SomeUsernameHe
Shopify Partner
519 58 113

This is the cause of the error, try commenting unstable_newEmbeddedAuthStrategy again

https://github.com/Shopify/shopify-app-js/tree/main/packages/shopify-app-remix#enabling-this-new-str...

Have I helped? Consider putting coffee in my mouth!
Buy Me a Coffee
921Kiyo
Shopify Partner
19 0 3

Thank you for the reply! I looked at shopify.server.ts, but I only have 

 

```

future: {
v3_webhookAdminContext: true,
v3_authenticatePublic: true,
},

```
As the template was generated before Feb. So looks like the cause is elsewhere..

Côme
Shopify Partner
6 0 0

Hi !

I know it's been a few months now, but I'm facing a similar issue.
Have you been able to find where the problem was coming from ?

Thanks !

willfranklyn
Shopify Partner
7 0 0

I am attempting to remove the `unstable_newEmbeddedAuthStrategy` on my own custom app right now and see if I can get rid of the 302 redirect. I will report back after.

willfranklyn
Shopify Partner
7 0 0

My app has a bit of a unique set up that I am hoping to accomplish: 1 hosted codebase, multiple custom apps pointing at it. I haven't really seen anyone take this approach before so I'm hoping it is possible. On my development store, the original app that I created loads normally but the other custom apps get the 302 redirect from /app and end up on /auth/session_token with a 200 but the page doesn't display anything.

willfranklyn
Shopify Partner
7 0 0

This did change where the 302 redirect was navigating in the "Location" header, but did not solve the issue. It is now navigating to /auth/exit-iframe and the app page displays nothing.

willfranklyn
Shopify Partner
7 0 0

The link that was provided here no longer exists. Is there an updated location for this?