Skip to content
This repository was archived by the owner on Mar 3, 2026. It is now read-only.
This repository was archived by the owner on Mar 3, 2026. It is now read-only.

cleanup(deps): Consideration of removing an unnecessary dependency (abort-controller) #2211

Open

Description

@SandZn

Hi,

I'm doing research on detecting unnecessary dependencies in NodeJs packages. I found that one dependency (abort-controller) is not necessary for your package.

I modified the package.json file to remove the abort-controller dependency, and I ran your tests. The testing result showed that all tests passed, and the test coverage did not change before and after I removed this dependency.

Would you consider removing this dependency to enhance security and reduce maintenance costs?

Activity

  1. added
    priority: p3Desirable enhancement or fix. May not be included in next release.
    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    on Jun 4, 2023
  2. ddelgrosso1 commented on Jun 5, 2023

    @ddelgrosso1
    Contributor

    Hi @SandZn unfortunately I do not think this is possible at this time. This library currently supports Node >= 12. AbortController did not become stable in Node until v15.4.0 . I am assuming you tested with a version >= 15.4.0 is that correct?

  3. self-assigned this
    on Jun 5, 2023
  4. SandZn commented on Jun 5, 2023

    @SandZn
    Author

    Correct. My node version is v16.17.0. Thank you for your response.

  5. ddelgrosso1 commented on Jun 5, 2023

    @ddelgrosso1
    Contributor

    @SandZn I'm going to keep this issue open and just update the title a bit to reflect the desire. When we move minimum node versions we would certainly be happy to remove abort-controller.

  6. added
    type: cleanupAn internal cleanup or hygiene concern.
    and removed
    priority: p3Desirable enhancement or fix. May not be included in next release.
    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    on Jun 5, 2023
  7. changed the title [-]Consideration of removing an unnecessary dependency[/-] [+]deps: Consideration of removing an unnecessary dependency (abort-controller)[/+] on Jun 5, 2023
  8. changed the title [-]deps: Consideration of removing an unnecessary dependency (abort-controller)[/-] [+]cleanup(deps): Consideration of removing an unnecessary dependency (abort-controller)[/+] on Jun 12, 2023
  9. removed their assignment
    on Jan 24, 2025
  10. manzonif commented on Nov 1, 2025

    @manzonif

    Hi! 👋
    We’re still experiencing this issue in recent versions of @google-cloud/storage, especially in ESM environments (e.g. Angular Universal / SSR with Node.js 20+).

    Even though PR #1889
    addressed the removal of the abort-controller polyfill, the current build of the package (e.g. build/src/resumable-upload.js) still imports:

    import AbortController from 'abort-controller';

    This causes runtime errors like:

    Error: Expected signal to be an instanceof AbortSignal

    when calling methods such as file.save() or file.download() after an AbortController was used in the SSR rendering context.

    In modern Node.js (>=18), a native AbortController is already available globally and works correctly. However, the library’s bundled ESM build forces the use of the old polyfill, which produces a non-standard AbortSignal instance that breaks compatibility.

    For now, patching the import (removing the abort-controller dependency) fixes the issue entirely.

    Would it be possible to:

    Remove the abort-controller dependency for Node 18+ (where native support exists),

    Or conditionally import the polyfill only when globalThis.AbortController is missing?

    This would improve compatibility and eliminate the need for manual patching in modern ESM / SSR environments.

    Thanks a lot for keeping this package solid — it’s a key dependency for many Node SSR workflows 🙏

  11. tushuhei commented on Nov 17, 2025

    @tushuhei

    +1 to remove abort-controller. This issue broke my SvelteKit / AppEngine / Node.js 22 setup.
    @ddelgrosso1 Do you have a plan to move the minimum supported Node.js version to v16 or above?

  12. ddelgrosso1 commented on Nov 17, 2025

    @ddelgrosso1
    Contributor

    @tushuhei yes there are still plans to move this library off of Node 14. cc: @thiyaguk09 who might be able to add more clarity as I no longer work directly on this library.

  13. thiyaguk09 commented on Nov 19, 2025

    @thiyaguk09
    Contributor

    The abort-controller has been removed from the Node 18 upgrade workflow, since this issue will be addressed with the Node 18 release.

  14. tushuhei commented on Nov 20, 2025

    @tushuhei

    Thank you @thiyaguk09 !

  15. ddelgrosso1 commented on Dec 10, 2025

    @ddelgrosso1
    Contributor

    Reopening because while this has been merged to the Node 18 branch it has not been released to the public.

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

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the googleapis/nodejs-storage API.next major: breaking changethis is a change that we should wait to bundle into the next major versiontype: cleanupAn internal cleanup or hygiene concern.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions