Issue with upload file local and API multipart body

I created an app where I can upload a txt, pdf or doc file using the Local update (widget state). After I upload the file I do a POST to an api that will expect 2 values as a request a String (comes from a custom action that generate a random uuid.v4) and a File. For this I use the multipart body structure with 2 variables (1st variable - type "String", 2nd variable - type "Uploaded File"). The problem I'm having is that sometimes it works and pass the 2 values and sometimes it doesn't and only pass the string. When it fail and only pass the String I get this error on the network log:

Cannot read properties of undefined (reading 'replace')

This issue appears when I run the app in test mode.

The widget I'm using to upload a file is a simple Button with an action to upload the file and then do a backend call to the POST api.

Does anyone has seen this issues before? I'm missing something?

7 replies