medusa icon indicating copy to clipboard operation
medusa copied to clipboard

Clicking on a Category redirects to a 500 Internal Server Error Page

Open Saadchr opened this issue 1 year ago • 2 comments

Hello, I've added the beta categories features to the admin variables I've created a category named ipad, and assigned a product to it The category name appears on the frontend as expected. When I click on it, I am directed to a 500 internal server error page.

https://medusa14-storefront-git-banner-saadchr.vercel.app/us

CleanShot 2024-02-08 at 20 36 56@2x

 {
    "TimeUTC": "2024-02-09 07:42:17",
    "timestampInMs": 1707464537720,
    "requestPath": "medusa14-storefront.vercel.app/us/categories/Ipad",
    "requestMethod": "GET",
    "responseStatusCode": 500,
    "requestId": "cdg1::xfwfp-1707464536666-55b85a97cde3",
    "requestUserAgent": [
      "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36"
    ],
    "level": "error",
    "environment": "production",
    "branch": "master",
    "vercelCache": "HIT",
    "type": "lambda",
    "function": "/[countryCode]/categories/[...category]",
    "host": "medusa14-storefront.vercel.app",
    "deploymentDomain": "medusa14-storefront-5r4i11qlb-saadchr.vercel.app",
    "deploymentId": "dpl_GoNCm5Zc2nXhuaNzG3BjiyDjRMcN",
    "lambdaDurationInMs": 851.25,
    "lambdaRegion": "-",
    "lambdaMaxMemoryUsed": 42,
    "lambdaMemorySize": 1024,
    "message": " ⨯ [Error: An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.] {\n  digest: 'DYNAMIC_SERVER_USAGE',\n  page: '/us/categories/Ipad'\n}\n[Error: An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.] {\n  digest: 'DYNAMIC_SERVER_USAGE',\n  page: '/us/categories/Ipad'\n}\nError: Runtime exited with error: exit status 1\nRuntime.ExitError\n",
    "projectId": "prj_BxFhgA2YrtkyV11YRnzB4Vde8asJ",
    "wafAction": "-"
  },
  {
    "TimeUTC": "2024-02-09 07:42:17",
    "timestampInMs": 1707464537671,
    "requestPath": "medusa14-storefront.vercel.app/us/collections/macbook",
    "requestMethod": "GET",
    "responseStatusCode": 200,
    "requestId": "cdg1::iad1::rpxc7-1707464536669-c93be477b85d",
    "requestUserAgent": [
      "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36"
    ],
    "level": "info",
    "environment": "production",
    "branch": "master",
    "vercelCache": "-",
    "type": "lambda",
    "function": "/[countryCode]/collections/[handle]",
    "host": "medusa14-storefront.vercel.app",
    "deploymentDomain": "medusa14-storefront.vercel.app",
    "deploymentId": "dpl_GoNCm5Zc2nXhuaNzG3BjiyDjRMcN",
    "lambdaDurationInMs": 69,
    "lambdaRegion": "-",
    "lambdaMaxMemoryUsed": 100,
    "lambdaMemorySize": 1024,
    "message": "[GET] /us/collections/macbook?_rsc=1dm41&nxtPcountryCode=us&nxtPhandle=macbook status=200\n",
    "projectId": "prj_BxFhgA2YrtkyV11YRnzB4Vde8asJ",
    "wafAction": "-"
  },

Thanks

Saadchr avatar Feb 08 '24 20:02 Saadchr

Removing this part form the src > app › [countryCode] ≥ (main) › categories › [...category] > page.tsx route makes it working fine :

// export async function generateMetadata({ params }: Props): Promise<Metadata> {
//   try {
//     const { product_categories } = await getCategoryByHandle(
//       params.category
//     ).then((product_categories) => product_categories)

//     const title = product_categories
//       .map((category) => category.name)
//       .join(" | ")

//     const description =
//       product_categories[product_categories.length - 1].description ??
//       `${title} category.`

//     return {
//       title: `${title} | Medusa Store`,
//       description,
//       alternates: {
//         canonical: `${params.category.join("/")}`,
//       },
//     }
//   } catch (error) {
//     notFound()
//   }
// }

Saadchr avatar Feb 09 '24 08:02 Saadchr

Why in the URL you have capital letter for the category handle? I am unable to reproduce this issue with a fresh install.

xyzones avatar Feb 28 '24 10:02 xyzones

Hey, thanks for the report! Since v2 brought a lot of architectural and API changes on the backend, we will be closing this ticket since it no longer applies to our new setup, or the issue has already been fixed. If you are still facing issues with v1, please open a new ticket and we will address it as soon as possible. Thanks! 🙏

sradevski avatar Jul 05 '24 11:07 sradevski