Skip to content

If the runtime environment does not have/support FormData and Blob. How should I do? #5543

@lcysgsg

Description

@lcysgsg

Describe the issue

I am developing a axios-adapter-uniapp for uniapp, when I apply it in wechat miniprogram, I got ReferenceError: FormData is not defined.

It seems to be used in inside axios, and I couldn't Eliminate this influence.

The axios-adapter-uniapp work with axios^0, couldn't work with axios^1.

Can you give me some guidance? Thank you very much.

屏幕截图 2023-02-13 175309

Example Code

here is the adapter [https://github.com/lcysgsg/axios-adapter-uniapp/tree/v1](https://github.com/lcysgsg/axios-adapter-uniapp/tree/v1)

Expected behavior

Avoid being affected by FormData and Blob.

Axios Version

1.3.2

Adapter Version

custom

Browser

wechat miniprogram

Browser Version

wechat miniprogram

Node.js Version

wechat miniprogram

OS

wechat miniprogram

Additional Library Versions

No response

Additional context/Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions