Skip to content

Axios onUploadProgress error - Cannot read property 'loaded' of undefined #6928

@handylib

Description

@handylib

Describe the bug

App crahses when proving onUploadProgress callback in axios options it was working pefectly in previous verions.

I get error

Cannot read property 'length' of undefined 

i think its because how axios it trying to calculate length form bytes or something, this whenever i add add the callback function event blank callbac function without logic it throws this error. if i remove the function everything work perfectly without any warnings or errors.

To Reproduce

No response

Code snippet

const response = await axios.post(url, body, {
                headers: headers,
                onUploadProgress: (e) => {
                    //This will throw error
                },
            });

Expected behavior

No response

Axios Version

1.9.0

Adapter Version

No response

Browser

No response

Browser Version

No response

Node.js Version

v22.0.0

OS

No response

Additional Library Versions

React Native - 0.79.2 (latest)

Additional context/Screenshots

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue::bugThis issue is related to a bug that requires fixing

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions