Hi,
I build a marketing site with Remix and deployed to Fly. Everything works fine. I then put AWS CloudFront in front of Fly and the page still works fine.
However, when I navigate to an internal page by clicking on a Remix Link component, the page crashes.
TypeError: Cannot destructure property 'data' of 'r' as it is undefined.
Basically, the loader returns nothing
const data = useLoaderData<LoaderData>();
// data is undefined
If I refresh the page, it works again.
I wonder why Remix Link is broken when I add CloudFront. How could it be possible and how to fix it?
Update: I start to think loader doesn't work when navigate with Remix Link (with CloudFront)