medusajs/medusa · error · MedusaError

NOT_FOUND

NOT_FOUND

Error message

Product tag with id: ${req.params.id} was not found

What it means

Thrown by GET /store/product-tags/:id when the query for the tag id returns no rows. The tag id is invalid or deleted. Returns 404 NOT_FOUND.

Source

Thrown at packages/medusa/src/api/store/product-tags/[id]/route.ts:33

  res: MedusaResponse<StoreProductTagResponse>
) => {
  const query = req.scope.resolve(ContainerRegistrationKeys.QUERY)

  const { data } = await query.graph(
    {
      entity: "product_tag",
      filters: {
        id: req.params.id,
      },
      fields: req.queryConfig.fields,
    },
    {
      locale: req.locale,
    }
  )

  if (!data.length) {
    throw new MedusaError(
      MedusaError.Types.NOT_FOUND,
      `Product tag with id: ${req.params.id} was not found`
    )
  }

  const productTag = data[0]

  res.json({ product_tag: productTag })
}

View on GitHub (pinned to 5e06e544a2)

Solutions

  1. List tags via GET /store/product-tags to confirm the id exists
  2. Update or remove storefront links referencing deleted tags
Defensive patterns

Strategy: try-catch

Try / catch

try {
  const { product_tag } = await sdk.store.productTag.retrieve(id)
} catch (e: any) {
  if (e.type === 'not_found') notFound()
  throw e
}

Prevention

When it happens

Trigger: Requesting /store/product-tags/ptag_... with a nonexistent or deleted tag id.

Common situations: Tag deleted via admin while storefront pages still link to it; ids from a stale sitemap or cached navigation.

Related errors


AI-assisted analysis of medusajs/medusa@5e06e544a2 (2026-08-27). Data as JSON: /api/errors/e46173ac2eda3c07. Report an issue: GitHub.