I’m getting an issue on my products page (products.$handle.tsx), here is the code:
import {defer, redirect, type LoaderFunctionArgs} from '@shopify/remix-oxygen';
import {useLoaderData, type MetaFunction} from '@remix-run/react';
import type {ProductFragment} from 'storefrontapi.generated';
import {getSelectedProductOptions} from '@shopify/hydrogen';
import type {SelectedOption} from '@shopify/hydrogen/storefront-api-types';
import {getVariantUrl} from '~/lib/variants';
import {VARIANTS_QUERY} from '~/components/product/graphql/varientsQuery';
import {PRODUCT_QUERY} from '~/components/product/graphql/productQuery';
import {ProductImage} from '~/components/product/ProductImage';
import {ProductMain} from '~/components/product/ProductMain';
import {AliReview} from '~/components/product/reviews/Review';
import {useState} from 'react';
import StickyAddToCart from '~/components/product/StickyAddToCart';
import {reviews} from '~/data/reviews/reviews';
import ReviewList from '~/components/product/reviews/ReviewList';
export const meta: MetaFunction
when I enter the URL manually or refresh its fine however when I access the URL from a Link from @remix-run/react or use the remix router I get this error:
```css
Oops
500
Cannot read properties of undefined (reading 'headers')
any ideas of how I can fix this / whats causing it? Thanks.