medusajs/medusa

[Bug]: Shipping option price resets from 0 to undefined (empty) when editing other regions/countries

已关闭

#15,450 创建于 2026年5月21日

 (2 条评论) (0 个反应) (0 位负责人)TypeScript (2,090 个派生)batch import
good first issuetype: bugversion: 2.0

仓库指标

星标
 (22,539 个星标)
PR 合并指标
 (平均合并 10天 22小时) (30 天内合并 185 个 PR)

描述

Package.json file

{
  "scripts": {
    "build": "medusa build",
    "seed": "medusa exec ./src/scripts/seed.ts",
    "start": "medusa start",
    "dev": "medusa develop --port 9000 --host xxxx",
    "test:integration:http": "TEST_TYPE=integration:http NODE_OPTIONS=--experimental-vm-modules jest --silent=false --runInBand --forceExit",
    "test:integration:modules": "TEST_TYPE=integration:modules NODE_OPTIONS=--experimental-vm-modules jest --silent=false --runInBand --forceExit",
    "test:unit": "TEST_TYPE=unit NODE_OPTIONS=--experimental-vm-modules jest --silent --runInBand --forceExit"
  },
  "dependencies": {
    "@aws-sdk/client-ses": "^3.1031.0",
    "@aws-sdk/client-sns": "^3.1020.0",
    "@aws-sdk/client-sqs": "^3.1040.0",
    "@medusajs/admin-sdk": "2.13.6",
    "@medusajs/cli": "2.15.2",
    "@medusajs/file-s3": "2.15.2",
    "@medusajs/framework": "2.15.2",
    "@medusajs/medusa": "2.15.2",
    "axios": "^1.13.4",
    "cloudevents": "^10.0.0"
  },
  "devDependencies": {
    "@medusajs/test-utils": "2.15.2",
    "@swc/core": "^1.7.28",
    "@swc/jest": "^0.2.36",
    "@types/jest": "^29.5.13",
    "@types/node": "^20.12.11",
    "@types/react": "^18.3.2",
    "@types/react-dom": "^18.2.25",
    "jest": "^29.7.0",
    "prop-types": "^15.8.1",
    "react": "^18.3.1",
    "react-dom": "^18.3.1",
    "ts-node": "^10.9.2",
    "typescript": "^5.6.2",
    "vite": "^5.4.14",
    "yalc": "^1.0.0-pre.53"
  },
  "engines": {
    "node": ">=20"
  },
  "packageManager": "yarn@1.22.22"
}

Node.js version

v20.19.2

Database and its version

Postgres 16

Operating system name and version

Docker node

Browser name

any

What happended?

In the Medusa Admin dashboard, when managing shipping option prices across multiple countries/regions, setting a shipping price to 0 (for free shipping) works on the initial save. However, if you return to edit the shipping option to modify prices for another country or region, the previously saved 0 values are cleared out and become undefined/empty. This causes frontend exceptions because the application expects a valid numeric price (or explicit zero) for those configured countries, but instead receives a missing price payload.

Expected behavior

A price explicitly set to 0 should be treated as a valid value and persisted through subsequent edits of the same shipping option, rather than being treated as "falsy" or empty and cleared out.

Actual behavior

The 0 price is dropped on subsequent updates, causing missing price data in the frontend API response.

Link to reproduction repo

no repo

贡献者指南