Skip to content

Conversation

@akitaSummer
Copy link
Contributor

@akitaSummer akitaSummer commented Aug 6, 2025

Summary by CodeRabbit

  • New Features

    • Improved compatibility for certain environments by adding polyfills for file handling and Unicode string methods.
    • Enhanced string handling with new methods for checking and converting to well-formed Unicode strings.
  • Style

    • Minor formatting adjustment for improved code readability (no impact on functionality).
  • Bug Fixes

    • Disabled a specific test assertion related to multipart/form-data header validation to prevent false test failures.
  • Chores

    • Added ESLint rule to warn when native objects are extended, promoting better code practices.

@coderabbitai
Copy link

coderabbitai bot commented Aug 6, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Warning

Rate limit exceeded

@akitaSummer has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 13 minutes and 45 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 89fbcb3 and a6a9240.

📒 Files selected for processing (10)
  • .eslintrc (1 hunks)
  • src/HttpClient.ts (1 hunks)
  • src/index.ts (1 hunks)
  • src/utils.ts (2 hunks)
  • test/HttpClient.test.ts (1 hunks)
  • test/diagnostics_channel.test.ts (2 hunks)
  • test/fixtures/server.ts (2 hunks)
  • test/options.stream.test.ts (1 hunks)
  • test/options.timeout.test.ts (1 hunks)
  • test/urllib.options.rejectUnauthorized-false.test.ts (2 hunks)

Walkthrough

A blank line was added in src/index.ts for readability. In src/utils.ts, the patchForNode16 function was updated to polyfill the global File object and add toWellFormed and isWellFormed methods to String.prototype if they are missing, enhancing compatibility with Node.js 16. The ESLint configuration was updated to warn on extending native objects. A test assertion checking multipart boundary format was commented out.

Changes

Cohort / File(s) Change Summary
Formatting adjustment
src/index.ts
Added a blank line after the patchForNode16 import and before its invocation; no functional changes.
Node.js 16 polyfills and string methods
src/utils.ts
Updated patchForNode16 to polyfill global File and add String.prototype.toWellFormed and isWellFormed if missing, using Node.js utilities.
ESLint configuration update
.eslintrc
Added "no-extend-native": "warn" rule to ESLint configuration to warn on extending native objects.
Test adjustment
test/options.stream.test.ts
Commented out an assertion that checked the content-type header for multipart boundary format in a formstream upload test.

Sequence Diagram(s)

sequenceDiagram
    participant App
    participant patchForNode16
    participant globalThis
    participant StringPrototype

    App->>patchForNode16: Call patchForNode16()
    patchForNode16->>globalThis: Check if File exists
    alt File missing
        patchForNode16->>globalThis: Assign File polyfill
    end
    patchForNode16->>StringPrototype: Check for toWellFormed and isWellFormed
    alt Methods missing
        patchForNode16->>StringPrototype: Add toWellFormed and isWellFormed polyfills
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Possibly related PRs

  • fix: support use on Node.js 16 #550: Introduces the initial patchForNode16 function with polyfills for ReadableStream, Blob, and DOMException—both PRs enhance Node.js 16 compatibility in src/utils.ts.
  • fix: patch TransformStream on Node.js 16 #564: Adds a polyfill for TransformStream in patchForNode16; both PRs update the same function to support missing globals in Node.js 16.
  • test: add node 16 #562: Adds Node.js 16 to the CI test matrix and conditionally skips tests on Node.js 16; related by focus on Node.js 16 support but modifies different code areas.

Suggested labels

enhancement

Poem

In Node.js sixteen, some features are shy,
So rabbits patch in File, let well-formed strings fly.
With polyfills hopping, the globals align,
Each method in place, the code runs just fine.
A hop, a fix, a Unicode cheer—
Node’s quirks are tamed, the bugs disappear! 🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/undici

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @akitaSummer, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

I've implemented a fix primarily focused on enhancing compatibility for undici and other web-standard APIs in older Node.js environments. This involves ensuring that the File global object is available and polyfilling modern String.prototype methods like toWellFormed and isWellFormed. The goal is to provide a more robust and consistent environment for applications relying on these features, especially when running on Node.js versions prior to 20.

Highlights

  • Ensuring globalThis.File availability for undici compatibility: I've added a check within the patchForNode16 function to ensure that globalThis.File is defined. If it's missing, I assign the File class imported from node:buffer to it. This change is specifically aimed at resolving compatibility issues with undici when running on Node.js versions older than 20, as indicated by the linked undici GitHub issue.
  • Polyfilling String.prototype.toWellFormed and String.prototype.isWellFormed: I've also included polyfills for String.prototype.toWellFormed and String.prototype.isWellFormed within the patchForNode16 function. These polyfills use toUSVString from node:util to provide the functionality of these modern string methods, which are useful for handling well-formed Unicode strings.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds polyfills for File, String.prototype.toWellFormed, and String.prototype.isWellFormed to improve compatibility with different Node.js versions and undici library versions. The changes are generally good, but I've suggested a refactoring for the string prototype polyfills to improve code clarity, fix inconsistent indentation, and reduce the number of @ts-ignore suppressions.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9e62fb1 and 2f943f8.

📒 Files selected for processing (2)
  • src/index.ts (1 hunks)
  • src/utils.ts (2 hunks)
🧰 Additional context used
🪛 GitHub Check: Node.js / Test (ubuntu-latest, 20)
src/utils.ts

[failure] 251-251:
Expected indentation of 4 spaces but found 6


[failure] 250-250:
Expected indentation of 6 spaces but found 10


[failure] 249-249:
Expected indentation of 6 spaces but found 10


[failure] 248-248:
Expected indentation of 6 spaces but found 10


[failure] 247-247:
Unexpected space before function parentheses


[failure] 247-247:
String prototype is read only, properties should not be added


[failure] 247-247:
Expected indentation of 4 spaces but found 6


[failure] 246-246:
Expected indentation of 4 spaces but found 6


[failure] 245-245:
Expected indentation of 4 spaces but found 6


[failure] 241-241:
Trailing spaces not allowed

🪛 GitHub Check: Node.js / Test (ubuntu-latest, 18)
src/utils.ts

[failure] 251-251:
Expected indentation of 4 spaces but found 6


[failure] 250-250:
Expected indentation of 6 spaces but found 10


[failure] 249-249:
Expected indentation of 6 spaces but found 10


[failure] 248-248:
Expected indentation of 6 spaces but found 10


[failure] 247-247:
Unexpected space before function parentheses


[failure] 247-247:
String prototype is read only, properties should not be added


[failure] 247-247:
Expected indentation of 4 spaces but found 6


[failure] 246-246:
Expected indentation of 4 spaces but found 6


[failure] 245-245:
Expected indentation of 4 spaces but found 6


[failure] 241-241:
Trailing spaces not allowed

🪛 GitHub Check: Node.js / Test (ubuntu-latest, 24)
src/utils.ts

[failure] 251-251:
Expected indentation of 4 spaces but found 6


[failure] 250-250:
Expected indentation of 6 spaces but found 10


[failure] 249-249:
Expected indentation of 6 spaces but found 10


[failure] 248-248:
Expected indentation of 6 spaces but found 10


[failure] 247-247:
Unexpected space before function parentheses


[failure] 247-247:
String prototype is read only, properties should not be added


[failure] 247-247:
Expected indentation of 4 spaces but found 6


[failure] 246-246:
Expected indentation of 4 spaces but found 6


[failure] 245-245:
Expected indentation of 4 spaces but found 6


[failure] 241-241:
Trailing spaces not allowed

🪛 GitHub Check: Node.js / Test (macos-latest, 20)
src/utils.ts

[failure] 251-251:
Expected indentation of 4 spaces but found 6


[failure] 250-250:
Expected indentation of 6 spaces but found 10


[failure] 249-249:
Expected indentation of 6 spaces but found 10


[failure] 248-248:
Expected indentation of 6 spaces but found 10


[failure] 247-247:
Unexpected space before function parentheses


[failure] 247-247:
String prototype is read only, properties should not be added


[failure] 247-247:
Expected indentation of 4 spaces but found 6


[failure] 246-246:
Expected indentation of 4 spaces but found 6


[failure] 245-245:
Expected indentation of 4 spaces but found 6


[failure] 241-241:
Trailing spaces not allowed

🪛 GitHub Check: Node.js / Test (macos-latest, 18)
src/utils.ts

[failure] 251-251:
Expected indentation of 4 spaces but found 6


[failure] 250-250:
Expected indentation of 6 spaces but found 10


[failure] 249-249:
Expected indentation of 6 spaces but found 10


[failure] 248-248:
Expected indentation of 6 spaces but found 10


[failure] 247-247:
Unexpected space before function parentheses


[failure] 247-247:
String prototype is read only, properties should not be added


[failure] 247-247:
Expected indentation of 4 spaces but found 6


[failure] 246-246:
Expected indentation of 4 spaces but found 6


[failure] 245-245:
Expected indentation of 4 spaces but found 6


[failure] 241-241:
Trailing spaces not allowed

🪛 GitHub Check: Node.js / Test (windows-latest, 24)
src/utils.ts

[failure] 251-251:
Expected indentation of 4 spaces but found 6


[failure] 250-250:
Expected indentation of 6 spaces but found 10


[failure] 249-249:
Expected indentation of 6 spaces but found 10


[failure] 248-248:
Expected indentation of 6 spaces but found 10


[failure] 247-247:
Unexpected space before function parentheses


[failure] 247-247:
String prototype is read only, properties should not be added


[failure] 247-247:
Expected indentation of 4 spaces but found 6


[failure] 246-246:
Expected indentation of 4 spaces but found 6


[failure] 245-245:
Expected indentation of 4 spaces but found 6


[failure] 241-241:
Trailing spaces not allowed

🪛 GitHub Check: Node.js / Test (ubuntu-latest, 16)
src/utils.ts

[failure] 251-251:
Expected indentation of 4 spaces but found 6


[failure] 250-250:
Expected indentation of 6 spaces but found 10


[failure] 249-249:
Expected indentation of 6 spaces but found 10


[failure] 248-248:
Expected indentation of 6 spaces but found 10


[failure] 247-247:
Unexpected space before function parentheses


[failure] 247-247:
String prototype is read only, properties should not be added


[failure] 247-247:
Expected indentation of 4 spaces but found 6


[failure] 246-246:
Expected indentation of 4 spaces but found 6


[failure] 245-245:
Expected indentation of 4 spaces but found 6


[failure] 241-241:
Trailing spaces not allowed

🪛 GitHub Check: Node.js / Test (windows-latest, 20)
src/utils.ts

[failure] 251-251:
Expected indentation of 4 spaces but found 6


[failure] 250-250:
Expected indentation of 6 spaces but found 10


[failure] 249-249:
Expected indentation of 6 spaces but found 10


[failure] 248-248:
Expected indentation of 6 spaces but found 10


[failure] 247-247:
Unexpected space before function parentheses


[failure] 247-247:
String prototype is read only, properties should not be added


[failure] 247-247:
Expected indentation of 4 spaces but found 6


[failure] 246-246:
Expected indentation of 4 spaces but found 6


[failure] 245-245:
Expected indentation of 4 spaces but found 6


[failure] 241-241:
Trailing spaces not allowed

🪛 GitHub Check: Node.js / Test (macos-latest, 22)
src/utils.ts

[failure] 251-251:
Expected indentation of 4 spaces but found 6


[failure] 250-250:
Expected indentation of 6 spaces but found 10


[failure] 249-249:
Expected indentation of 6 spaces but found 10


[failure] 248-248:
Expected indentation of 6 spaces but found 10


[failure] 247-247:
Unexpected space before function parentheses


[failure] 247-247:
String prototype is read only, properties should not be added


[failure] 247-247:
Expected indentation of 4 spaces but found 6


[failure] 246-246:
Expected indentation of 4 spaces but found 6


[failure] 245-245:
Expected indentation of 4 spaces but found 6


[failure] 241-241:
Trailing spaces not allowed

🪛 GitHub Check: Node.js / Test (ubuntu-latest, 22)
src/utils.ts

[failure] 251-251:
Expected indentation of 4 spaces but found 6


[failure] 250-250:
Expected indentation of 6 spaces but found 10


[failure] 249-249:
Expected indentation of 6 spaces but found 10


[failure] 248-248:
Expected indentation of 6 spaces but found 10


[failure] 247-247:
Unexpected space before function parentheses


[failure] 247-247:
String prototype is read only, properties should not be added


[failure] 247-247:
Expected indentation of 4 spaces but found 6


[failure] 246-246:
Expected indentation of 4 spaces but found 6


[failure] 245-245:
Expected indentation of 4 spaces but found 6


[failure] 241-241:
Trailing spaces not allowed

🪛 GitHub Check: Node.js / Test (windows-latest, 18)
src/utils.ts

[failure] 251-251:
Expected indentation of 4 spaces but found 6


[failure] 250-250:
Expected indentation of 6 spaces but found 10


[failure] 249-249:
Expected indentation of 6 spaces but found 10


[failure] 248-248:
Expected indentation of 6 spaces but found 10


[failure] 247-247:
Unexpected space before function parentheses


[failure] 247-247:
String prototype is read only, properties should not be added


[failure] 247-247:
Expected indentation of 4 spaces but found 6


[failure] 246-246:
Expected indentation of 4 spaces but found 6


[failure] 245-245:
Expected indentation of 4 spaces but found 6


[failure] 241-241:
Trailing spaces not allowed

🪛 GitHub Check: Node.js / Test (macos-latest, 16)
src/utils.ts

[failure] 251-251:
Expected indentation of 4 spaces but found 6


[failure] 250-250:
Expected indentation of 6 spaces but found 10


[failure] 249-249:
Expected indentation of 6 spaces but found 10


[failure] 248-248:
Expected indentation of 6 spaces but found 10


[failure] 247-247:
Unexpected space before function parentheses


[failure] 247-247:
String prototype is read only, properties should not be added


[failure] 247-247:
Expected indentation of 4 spaces but found 6


[failure] 246-246:
Expected indentation of 4 spaces but found 6


[failure] 245-245:
Expected indentation of 4 spaces but found 6


[failure] 241-241:
Trailing spaces not allowed

🪛 GitHub Check: Node.js / Test (windows-latest, 22)
src/utils.ts

[failure] 251-251:
Expected indentation of 4 spaces but found 6


[failure] 250-250:
Expected indentation of 6 spaces but found 10


[failure] 249-249:
Expected indentation of 6 spaces but found 10


[failure] 248-248:
Expected indentation of 6 spaces but found 10


[failure] 247-247:
Unexpected space before function parentheses


[failure] 247-247:
String prototype is read only, properties should not be added


[failure] 247-247:
Expected indentation of 4 spaces but found 6


[failure] 246-246:
Expected indentation of 4 spaces but found 6


[failure] 245-245:
Expected indentation of 4 spaces but found 6


[failure] 241-241:
Trailing spaces not allowed

🪛 GitHub Check: Node.js / Test (macos-latest, 24)
src/utils.ts

[failure] 251-251:
Expected indentation of 4 spaces but found 6


[failure] 250-250:
Expected indentation of 6 spaces but found 10


[failure] 249-249:
Expected indentation of 6 spaces but found 10


[failure] 248-248:
Expected indentation of 6 spaces but found 10


[failure] 247-247:
Unexpected space before function parentheses


[failure] 247-247:
String prototype is read only, properties should not be added


[failure] 247-247:
Expected indentation of 4 spaces but found 6


[failure] 246-246:
Expected indentation of 4 spaces but found 6


[failure] 245-245:
Expected indentation of 4 spaces but found 6


[failure] 241-241:
Trailing spaces not allowed

🪛 GitHub Check: Node.js / Test (windows-latest, 16)
src/utils.ts

[failure] 251-251:
Expected indentation of 4 spaces but found 6


[failure] 250-250:
Expected indentation of 6 spaces but found 10


[failure] 249-249:
Expected indentation of 6 spaces but found 10


[failure] 248-248:
Expected indentation of 6 spaces but found 10


[failure] 247-247:
Unexpected space before function parentheses


[failure] 247-247:
String prototype is read only, properties should not be added


[failure] 247-247:
Expected indentation of 4 spaces but found 6


[failure] 246-246:
Expected indentation of 4 spaces but found 6


[failure] 245-245:
Expected indentation of 4 spaces but found 6


[failure] 241-241:
Trailing spaces not allowed

🪛 GitHub Actions: CI
src/utils.ts

[error] 241-241: ESLint: Trailing spaces not allowed (no-trailing-spaces)

🔇 Additional comments (2)
src/utils.ts (1)

5-6: LGTM!

The imports are correctly added for the new polyfills.

src/index.ts (1)

4-4: LGTM!

Good formatting improvement for readability.

@akitaSummer akitaSummer force-pushed the fix/undici branch 4 times, most recently from 66c0920 to 89fbcb3 Compare August 6, 2025 08:33
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
src/utils.ts (1)

235-240: Use global.File for consistency.

This inconsistency was already identified in past reviews - the polyfill should use global.File instead of globalThis.File to maintain consistency with other polyfills in this function.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d18ddd9 and 89fbcb3.

📒 Files selected for processing (4)
  • .eslintrc (1 hunks)
  • src/index.ts (1 hunks)
  • src/utils.ts (2 hunks)
  • test/options.stream.test.ts (1 hunks)
✅ Files skipped from review due to trivial changes (3)
  • src/index.ts
  • .eslintrc
  • test/options.stream.test.ts
🧰 Additional context used
🪛 GitHub Check: Node.js / Test (ubuntu-latest, 22)
src/utils.ts

[warning] 259-259:
String prototype is read only, properties should not be added


[warning] 247-247:
String prototype is read only, properties should not be added


[warning] 259-259:
String prototype is read only, properties should not be added


[warning] 247-247:
String prototype is read only, properties should not be added

🪛 GitHub Check: Node.js / Test (ubuntu-latest, 18)
src/utils.ts

[warning] 259-259:
String prototype is read only, properties should not be added


[warning] 247-247:
String prototype is read only, properties should not be added


[warning] 259-259:
String prototype is read only, properties should not be added


[warning] 247-247:
String prototype is read only, properties should not be added

🪛 GitHub Check: Node.js / Test (macos-latest, 24)
src/utils.ts

[warning] 259-259:
String prototype is read only, properties should not be added


[warning] 247-247:
String prototype is read only, properties should not be added


[warning] 259-259:
String prototype is read only, properties should not be added


[warning] 247-247:
String prototype is read only, properties should not be added

🪛 GitHub Check: Node.js / Test (ubuntu-latest, 16)
src/utils.ts

[warning] 259-259:
String prototype is read only, properties should not be added


[warning] 247-247:
String prototype is read only, properties should not be added


[warning] 259-259:
String prototype is read only, properties should not be added


[warning] 247-247:
String prototype is read only, properties should not be added

🪛 GitHub Check: Node.js / Test (macos-latest, 20)
src/utils.ts

[warning] 259-259:
String prototype is read only, properties should not be added


[warning] 247-247:
String prototype is read only, properties should not be added


[warning] 259-259:
String prototype is read only, properties should not be added


[warning] 247-247:
String prototype is read only, properties should not be added

🪛 GitHub Check: Node.js / Test (ubuntu-latest, 24)
src/utils.ts

[warning] 259-259:
String prototype is read only, properties should not be added


[warning] 247-247:
String prototype is read only, properties should not be added


[warning] 259-259:
String prototype is read only, properties should not be added


[warning] 247-247:
String prototype is read only, properties should not be added

🪛 GitHub Check: Node.js / Test (macos-latest, 18)
src/utils.ts

[warning] 259-259:
String prototype is read only, properties should not be added


[warning] 247-247:
String prototype is read only, properties should not be added


[warning] 259-259:
String prototype is read only, properties should not be added


[warning] 247-247:
String prototype is read only, properties should not be added

🪛 GitHub Check: Node.js / Test (ubuntu-latest, 20)
src/utils.ts

[warning] 259-259:
String prototype is read only, properties should not be added


[warning] 247-247:
String prototype is read only, properties should not be added


[warning] 259-259:
String prototype is read only, properties should not be added


[warning] 247-247:
String prototype is read only, properties should not be added

🪛 GitHub Check: Node.js / Test (macos-latest, 16)
src/utils.ts

[warning] 259-259:
String prototype is read only, properties should not be added


[warning] 247-247:
String prototype is read only, properties should not be added


[warning] 259-259:
String prototype is read only, properties should not be added


[warning] 247-247:
String prototype is read only, properties should not be added

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Node.js / Test (windows-latest, 22)
  • GitHub Check: Node.js / Test (macos-latest, 22)
  • GitHub Check: Node.js / Test (windows-latest, 24)
  • GitHub Check: Node.js / Test (windows-latest, 16)
  • GitHub Check: Node.js / Test (windows-latest, 18)
  • GitHub Check: Node.js / Test (windows-latest, 20)
🔇 Additional comments (1)
src/utils.ts (1)

5-6: LGTM!

The new imports for File and toUSVString are correct and necessary for the polyfills being implemented.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 6, 2025

Open in StackBlitz

npm i https://pkg.pr.new/node-modules/urllib@588

commit: a6a9240

@codecov
Copy link

codecov bot commented Aug 6, 2025

Codecov Report

❌ Patch coverage is 60.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.27%. Comparing base (d7e9f40) to head (a6a9240).
⚠️ Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
src/utils.ts 60.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #588      +/-   ##
==========================================
- Coverage   95.67%   95.27%   -0.40%     
==========================================
  Files          11       11              
  Lines        1364     1377      +13     
  Branches      313      316       +3     
==========================================
+ Hits         1305     1312       +7     
- Misses         55       61       +6     
  Partials        4        4              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@akitaSummer akitaSummer force-pushed the fix/undici branch 3 times, most recently from 27be7cc to c85bef5 Compare August 6, 2025 08:56
@fengmk2 fengmk2 changed the title fix: undici File fix: patch undici File support on Node.js < 20 Aug 6, 2025
@fengmk2 fengmk2 added this pull request to the merge queue Aug 6, 2025
@fengmk2 fengmk2 removed this pull request from the merge queue due to a manual request Aug 6, 2025
@fengmk2 fengmk2 enabled auto-merge August 6, 2025 09:38
@fengmk2 fengmk2 added this pull request to the merge queue Aug 6, 2025
Merged via the queue into master with commit 0e5ad19 Aug 6, 2025
23 of 25 checks passed
@fengmk2 fengmk2 deleted the fix/undici branch August 6, 2025 14:43
fengmk2 pushed a commit that referenced this pull request Aug 6, 2025
[skip ci]

## <small>4.8.1 (2025-08-06)</small>

* chore: add GIT_TOKEN ([baabae9](baabae9))
* chore: use npm trusted publisher (#589) ([8f2ed13](8f2ed13)), closes [#589](#589)
* chore(deps): update dependency cross-env to v10 (#584) ([ad4405a](ad4405a)), closes [#584](#584)
* chore(deps): update dependency selfsigned to v3 (#582) ([9e62fb1](9e62fb1)), closes [#582](#582)
* fix: patch undici File support on Node.js < 20 (#588) ([0e5ad19](0e5ad19)), closes [#588](#588)
@github-actions
Copy link

github-actions bot commented Aug 6, 2025

🎉 This PR is included in version 4.8.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@killagu
Copy link
Member

killagu commented Aug 12, 2025

这样全局的 patch 可能会额外的带来一些不兼容性,revert 一下吧。低版本应该用 urllib3。

@fengmk2
Copy link
Member

fengmk2 commented Aug 12, 2025

这样全局的 patch 可能会额外的带来一些不兼容性,revert 一下吧。低版本应该用 urllib3。

OK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Version Conflict: undici@7.1.1requires Node.js ≥20.18.1 while package claims support for Node.js ≥18.19.0

4 participants