Skip to content

cloudflare: importing node:http wrongly import the unenv stream polyfill  #353

@vicb

Description

@vicb

Environment

7a9f230
Nodejs 22.11.0

Reproduction

See https://github.com/unjs/unenv/pull/352/files#diff-2f5c73584260f31cbdff9f65cf07fd8f619f8b48ddda9d87e1e99d583ac0f87c

Describe the bug

Without the PR, importing node:http also imports the unenv polyfill for stream because it is imported as a relative path.

Because the Readable polyfill does not implement the async iterator the test would throw [unenv] Readable.asyncIterator is not implemented yet!.

For cloudflare, the builtin stream implementation should be used instead.

Additional context

See the comments in the tentative PR

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    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