Skip to content

Symbol.toStringTag is missing on File, Blob and FormData #1641

Open
@octet-stream

Description

@octet-stream

Hi. I have discovered that Symbol.toStringTag is missing on File, Blob and FormData which causes compatibility issues for my library, which implements FormData and few other interfaces for Node. Some people still using it and they have this kind of issue, when they need to use it with fetch API. You can find more information here: octet-stream/form-data#57

This symbol is present in every implementation I've tested: Chrome v118.0.5993.117, Safari v17.1, Firefox v116.0.3, Deno v1.37.2, Node v21.1.0 (which inherits its implementation from undici), and Bun v1.0.8. I think this symbol should be present in types as well.

For more context: I also use this property for Symbol.hasInstance checks in my FormData, File and Blob implementations to verify if given value is an object that implements compatible API for these interfaces.

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