Skip to content

[bug]: Opening a project crashes in Safari/iOS — window.requestIdleCallback is not a function (gantt-layout-loader, unguarded) #9134

@jakeaddis

Description

@jakeaddis

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

Current behavior

On a self-hosted v1.3.1 instance, opening any project layout view in Safari (macOS) and Safari (iOS) immediately trips the React error
boundary ("🚧 Looks like something went wrong!"). Login, the projects list, and individual work-item peek/detail drawers all work — only the project layout view crashes.

The Network tab shows zero failed requests; this is a pure client-side JS exception. Captured console error:

    TypeError: window.requestIdleCallback is not a function.
      (In 'window.requestIdleCallback(()=>{h.current &&
(S.current=`${h.current.offsetHeight}px`)})',
       'window.requestIdleCallback' is undefined)
      (anonymous function) — gantt-layout-loader-<hash>.js:1:5524
    → React Router caught the following error during render
    → componentDidCatch — chunk-<hash>.js

Root cause

The gantt-layout-loader chunk calls window.requestIdleCallback(...) with no feature-detection and no polyfill. Safari does not ship requestIdleCallback by default on any version — it is gated behind a WebKit feature flag (WebKit bug 164193, still open; see caniuse). The call therefore throws a TypeError in Safari/iOS, which bubbles through the React Router render and trips the error boundary. The project layout view pulls in this chunk; the work-item drawer does not, which is why the drawer still renders.

Chrome and Firefox are unaffected because both have shipped requestIdleCallback for years.

Expected behavior

The project layout view renders in Safari/iOS, as it does in Chrome/Firefox.

Suggested fix

Guard the call or ship a polyfill. Minimal feature-detect:

    (window.requestIdleCallback || ((cb) => setTimeout(() =>
      cb({ didTimeout: false, timeRemaining: () => 50 }), 1)))(callback);

or register a global requestIdleCallback/cancelIdleCallback shim during app bootstrap so all call sites are covered. This is a common Safari-compat shim (e.g. the aFarkas/requestIdleCallback polyfill).

Workaround

Enable the WebKit requestIdleCallback feature flag per device (macOS: Develop → Feature Flags; iOS: Settings → Apps → Safari → Advanced → Feature Flags). Confirmed to resolve the crash, but it is a per-device manual toggle and not viable at scale.

Steps to reproduce

  1. Self-host v1.3.1 (Community Edition).
  2. Open the instance in Safari on macOS or iOS (default settings — i.e. without the experimental requestIdleCallback WebKit flag enabled).
  3. Click into any project. Console shows TypeError: window.requestIdleCallback is not a function.

Environment

Production

Browser

Safari

Variant

Self-hosted

Version

v1.3.1 CE

Metadata

Metadata

Assignees

Labels

planesync issues to Plane🐛bugSomething isn't working

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