Keep getting redirected away from app

While working on an app in the Shopify Admin every now and then I run into this problem where the page keeps redirecting me away to https://admin.shopify.com/store/<storename>/apps/<appname>/auth/exit-iframe?exitIframe=%2Fauth%3Fshop%3D<storename>.myshopify.com. This happens as soon as my app pages loads (via the p shortcut on the terminal)

After a couple of times this times out and I end up on the ‘apps’ overview page with an error message telling me third party cookies are not enabled. I’ve been working on this app for the last week, on the same system, without any problems. Sometimes I manage to somehow get around this and I’m able to use the app for a bit, but this redirect will start again randomly every few days or so.

Any suggestions?

Using latest Firefox, with all adblocks disabled for the Shopify domain.

Hey Jasper,

I haven’t heard of this before - is it only on Firefox? Will this happen on any app or store for you?

Ok, I’m totally stumped now…

I only have the one test store and app I’m working on at the moment.

I just made sure my laptop and desktop (both running Pop OS) are using the exact same git commit. Removed and reinstalled all node_modules from the package.json in the repo and copied over any files that are not in the repo (like .env) to make sure they are the same. Removed .cache and cleared /build to start with a clean state.

If I run the server from my desktop using npm run dev and visit the preview URL, I get redirected, both on desktop and on laptop

If I run the server from my laptop (again, this is the exact same project code!) and visit the URL, the app works, both on desktop and on laptop.

To me, this means the 3rd party cookies error I’m getting can’t be the actual problem


By the way, why does Firefox show a temporary toast with the error, while Chromium shows a fixed banner?

Firefox:
image

Chromium:

Is it possible there’s some dependancy in your dev environment that’s different between the laptop and desktop, that’s somehow causing this issue - eg: an older version of Ruby or similar?

Will ask about the differences in warnings - these should be more consistant.

I ended up using shopify init to create a new project with the Remix template and merged that with my existing project, which seems to have done the trick, with the added benefit of using current versions of all dependencies.

Somewhere, something must have gone wrong on my end. It would just be nice if the error would reflect that, instead of the odd ‘3rd party cookies’ message.

Thanks for taking a look!


Side-note: I’ve always wondered: when you use the Remix template you also get a page in app/routes/_index/route.tsx with some text like “A short heading about [your app]”, but this page is not used in Shopify and seems to only be available locally, what is it for?

Glad you figured this out! Agree on the messaging - this could be improved.

@Jasper The page you are talking about “A Short heading about [your app]” serves a purpose. That is the home page of your app. Shopify renders everything inside /app in its admin. If you directly go to your app url you see this page.

You can style this page and use this an an alternative way to install your app on a store.

Example: https://pixi.astrl.link/ (This is our app. If you enter a myshopify domain it will install the app on that store)

1 Like