Skip to content

v5: docs about environments without AbortController does not match actual behavior #5837

@CoolSpring8

Description

@CoolSpring8

Describe the bug

Hello,

While working on a WeChat mini program and using the latest v5 beta (v5.0.0-beta.14) of @tanstack/react-query, I encountered an error: ReferenceError: AbortController is not defined. Although it is true that the WeChat mini program lacks support for AbortController (and probably does not fall under the category of "modern browsers" as required by v5 -- description of the runtime), this behavior does not align with the current documentation.

According to the latest documentation available at https://tanstack.com/query/v5/docs/react/guides/query-cancellation, it states that "The AbortController API is available in most runtime environments. However, if the runtime environment does not support it, the query function will receive undefined in its place."

However, the recent commit b3f3c59 introduced a change to drop support for browsers without the API.

Since v5 targets modern browsers, I guess this change is not considered a regression. Therefore, I suggest removing that statement from the documentation to avoid confusion for users in unsupported environments. Polyfills would be needed in these environments.

Thank you for your attention to this matter.

Your minimal, reproducible example

https://codesandbox.io/p/sandbox/epic-pike-pknnjh

Steps to reproduce

  1. (The sandbox uses "delete window.AbortController" to simulate browsers without AbortController API)
  2. Open console
  3. See error Uncaught ReferenceError: AbortController is not defined

Expected behavior

Expected the page to function normally

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

  • OS: macOS
  • Browser: Weixin DevTools
  • Version: 1.06.2307250 (NW.js 0.54.1)

Tanstack Query adapter

react-query

TanStack Query version

v5.0.0-beta.14

TypeScript version

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationv5

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions