App reviews, troubleshooting, and recommendations
Hi,
I'm trying to do a redirect in the loader of my remix app and things are working fine in development. However, in production the redirect works but it doesn't seem like any of the javascript is loaded so none of the interactions work. I noticed that the path in the URL doesn't have the `/app/onboard` at the end.
I'm just doing a simple redirect based on a boolean from prisma.
export async function loader({ request }) { const { admin, session, redirect } = await authenticate.admin(request); const shopData = await admin.rest.resources.Shop.all({ session: session });
const shopDomain = shopData?.data[0].domain; let merchant = await prisma.merchant.findFirst({ where: { shop: shopDomain} }) if (!merchant?.onboarding_complete) { return redirect(`/app/onboard`);
# url redirect to is https://admin.shopify.com/store/dipsy-doodle-boutique/apps/littleregistry-prod, would expect https://admin.shopify.com/store/dipsy-doodle-boutique/apps/littleregistry-prod/app/onboard }
Hi @apochocolate , it looks like the issue is that in production this code runs on the server side, different from development (reason why it works on the second but not on the first). If your app runs in an admin iframe, have you tried using Shopify.Context.redirect to handle navigation within it?
All the best!
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024