Skip to content
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

Link not working when app is deployed to Cloudflare Pages #878

Open
lukeclifton opened this issue Oct 31, 2024 · 3 comments
Open

Link not working when app is deployed to Cloudflare Pages #878

lukeclifton opened this issue Oct 31, 2024 · 3 comments

Comments

@lukeclifton
Copy link

lukeclifton commented Oct 31, 2024

I have a Link on my app page which when running my app locally works as it should:

import { Link } from "@remix-run/react";
<Link variant="primary" to={`/app/discount-function/${id}/create`}>Create Discount</Link>

However when I deploy the app to Cloudflare Pages, this link does not work. Just nothing happens when it's clicked.

Anyone have any thoughts or ideas as to what is causing this?

Thanks!

@loreleim
Copy link

What errors are you seeing in the Cloudflare Pages logs? Just this morning I'm seeing issues with a Render deployed app. But like you, my local dev is working. I've been getting this error in my logs, where GraphQL just doesn't seem to be hitting?

[shopify-app/INFO] Authenticating app proxy request
TypeError: Cannot read properties of undefined (reading 'graphql')
    at action$1 (file:///app/build/server/index.js?t=1730406106000:901:36)
    at Object.callRouteAction (/app/node_modules/@remix-run/server-runtime/dist/data.js:36:16)
    at /app/node_modules/@remix-run/router/router.ts:4899:19
    at callLoaderOrAction (/app/node_modules/@remix-run/router/router.ts:4963:16)
    at async Promise.all (index 0)
    at defaultDataStrategy (/app/node_modules/@remix-run/router/router.ts:4772:17)
    at callDataStrategyImpl (/app/node_modules/@remix-run/router/router.ts:4835:17)
    at callDataStrategy (/app/node_modules/@remix-run/router/router.ts:3992:19)
    at submit (/app/node_modules/@remix-run/router/router.ts:3755:21)
    at queryImpl (/app/node_modules/@remix-run/router/router.ts:3684:22)

@lukeclifton
Copy link
Author

What errors are you seeing in the Cloudflare Pages logs? Just this morning I'm seeing issues with a Render deployed app. But like you, my local dev is working. I've been getting this error in my logs, where GraphQL just doesn't seem to be hitting?

[shopify-app/INFO] Authenticating app proxy request
TypeError: Cannot read properties of undefined (reading 'graphql')
    at action$1 (file:///app/build/server/index.js?t=1730406106000:901:36)
    at Object.callRouteAction (/app/node_modules/@remix-run/server-runtime/dist/data.js:36:16)
    at /app/node_modules/@remix-run/router/router.ts:4899:19
    at callLoaderOrAction (/app/node_modules/@remix-run/router/router.ts:4963:16)
    at async Promise.all (index 0)
    at defaultDataStrategy (/app/node_modules/@remix-run/router/router.ts:4772:17)
    at callDataStrategyImpl (/app/node_modules/@remix-run/router/router.ts:4835:17)
    at callDataStrategy (/app/node_modules/@remix-run/router/router.ts:3992:19)
    at submit (/app/node_modules/@remix-run/router/router.ts:3755:21)
    at queryImpl (/app/node_modules/@remix-run/router/router.ts:3684:22)

Hey @loreleim I am not seeing any errors in Cloudflare logs. It's just that the link won't work.

@lukeclifton
Copy link
Author

Just adding here that if I use Link component from Polaris instead then I get a auth issue and am redirected to the app login page.

This seems contrary to the info here:
https://github.com/Shopify/shopify-app-template-remix?tab=readme-ov-file#navigatingredirecting-breaks-an-embedded-app

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants