Skip to content

[Bug]: row.original.payment_collections is undefined on newly introduced customer details refunds #14332

@RobbyUitbeijerse

Description

@RobbyUitbeijerse

Package.json file

-

Node.js version

24

Database and its version

Operating system name and version

Browser name

No response

What happended?

Uncaught TypeError: Cannot read properties of undefined (reading 'reduce')

This error breaks loading the customer detail page UI for customers with fully refunded orders.

Error thrown on this line: https://github.com/medusajs/medusa/pull/14077/changes#diff-475f259a0b44f05c71be6c4e7c4c60c6ecf17128cbe8322f7de3b180e10e0cb8R102-R107

It seems row.original.payment_collections is undefined, resulting in a type error for the reduce call. There are payment collections for the orders in the db.

Reverting to 2.12.1 solves the issue

Expected behavior

row.original.payment_collections is not undefined or is handled with an empty array fallback || []

Actual behavior

row.original.payment_collections is undefined and the .reduce method is directly called on it, cauhing the customer details route to throw.

Link to reproduction repo

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions