medusajs/medusa

[Bug]: Admin dashboard crashes when viewing orders with fulfillments referencing deleted stock locations

Open

#14672 opened on Jan 30, 2026

View on GitHub
 (5 comments) (0 reactions) (0 assignees)TypeScript (22,539 stars) (2,090 forks)batch import
good first issuetype: bugversion: 2.0

Description

Package.json file

{
  "name": "medusa-play-4-local",
  "version": "0.0.1",
  "description": "A starter for Medusa projects.",
  "author": "Medusa (https://medusajs.com)",
  "license": "MIT",
  "dependencies": {
    "@medusajs/admin-sdk": "2.12.5",
    "@medusajs/cli": "2.12.5",
    "@medusajs/framework": "2.12.5",
    "@medusajs/icons": "^2.1.3",
    "@medusajs/medusa": "2.12.5"
  },
  "devDependencies": {
    "@medusajs/test-utils": "2.12.5"
  },
  "engines": {
    "node": ">=20"
  }
}

Node.js version

v20.18.1

Database and its version

PostgreSQL 14.17 (Homebrew)

Operating system name and version

macOS Darwin 23.5.0

Browser name

All

What happended?

When opening an order detail page in the admin dashboard that has fulfillments referencing a deleted stock location, the page crashes with:

(Console) Error: Stock location with id: sloc_xxx was not found

The page loads briefly then crashes when the async stock location fetch completes.

Suspected root cause is in: packages/admin/dashboard/src/routes/orders/order-detail/components/order-fulfillment-section/order-fulfillment-section.tsx

The component throws the error instead of handling it gracefully:

if (isError) { throw error // ?? }

Expected behavior

The admin dashboard should handle deleted stock location references gracefully - either display "Location deleted" or skip displaying the location, but not crash the entire order detail page.

Actual behavior

The page crashes, making it impossible to view or manage orders that have fulfillments with deleted stock location references.

Link to reproduction repo

N/A - Can be reproduced in any Medusa v2 project: 1. Create a stock location 2. Fulfill an order using that location 3. Delete the stock location 4. View the order - page crashes

Contributor guide