-
Notifications
You must be signed in to change notification settings - Fork 128
Description
Description
Hi !
Thank you for the great project !
I just wanted to mention that the SellerRequestDetail
component in the Medusa Admin dashboard throws a runtime error when certain nested fields in the request.data
object (like seller.name
, member.name
, or provider_identity_id
) are missing.
This causes the entire page to crash with:
TypeError: Cannot read properties of undefined (reading 'name')
This typically happens if the data
JSON from the database does not include those keys (e.g. "member"
is missing entirely).
Here is the proposed fix , which I tried and it works.
We could wrap nested field accesses with optional chaining and fallback values:
<Text>{requestData?.seller?.name ?? 'N/A'}</Text>
<Text>{requestData?.member?.name ?? 'N/A'}</Text>
<Text>{requestData?.provider_identity_id ?? 'N/A'}</Text>
Also suggesting defining a local type (SellerRequestData
) to avoid casting request.data
as any
.
This will make the component more resilient and prevent unexpected UI crashes when fields are missing from the request.
Full updated code
https://gist.github.com/rezabanitaba/8ad75b556237b000e236a6548822ccb0
After update