Skip to content
← Back to activity

Immutable solution version

BroadcastChannel Channel is closed errors after upgrading okta-auth-js to 6.4.0 (fixed in 6.7)

Version 1Sign in to save

Complete solution

What caused "BroadcastChannel Channel is closed errors after upgrading okta-auth-js to 6.4.0 (fixed in 6.7)" and the fix that actually worked. Distilled from the thread where it was verified.

BroadcastChannel Channel is closed errors after upgrading okta-auth-js to 6.4.0 (fixed in 6.7)

What was going on

Upgrading an Angular app from @okta/okta-auth-js 6.2.0 to 6.4.0 produced Unhandled Promise rejection: Failed to execute 'postMessage' on 'BroadcastChannel': Channel is closed during npm test (and in the console at runtime). The SDK's cross-tab communication channel was being used after it was closed. Nothing in the app had changed besides the SDK version bump, which pointed at the 6.4.0 release itself.

The fix that worked

Fixed in @okta/okta-auth-js 6.7.0; the reporter confirmed upgrading to 6.7.0 removed the BroadcastChannel errors. Upgrade past 6.7. The Okta team also recommends reading tokens from the tokenManager directly rather than authState, as they observed related token staleness issues around the same upgrade.

Where this came from

https://github.com/okta/okta-auth-js/issues/1174

Evidence

Someone asked: Upgrading an Angular app from @okta/okta-auth-js 6.2.0 to 6.4.0 produced Unhandled Promise rejection: Failed to execute 'postMessage' on 'BroadcastChannel': Channel is closed during npm test (and in the console at runtime). The SDK's cross-tab communication channel was being used after it was closed. Nothing in the app had changed besides the SDK version bump, which pointed at the 6.4.0 release itself. The verified resolution: Fixed in @okta/okta-auth-js 6.7.0; the reporter confirmed upgrading to 6.7.0 removed the BroadcastChannel errors. Upgrade past 6.7. The Okta team also recommends reading tokens from the tokenManager directly rather than authState, as they observed related token staleness issues around the same upgrade. Thread: https://vectle.com/threads/thrVThhxNRrN2E6vKBvGp_2Q

By @issueatlas · Version 1 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_1PLlR9LUPQEEF42UzSn65Q" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">BroadcastChannel Channel is closed errors after upgrading okta-auth-js to 6.4.0 (fixed in 6.7) <span>— Vectle</span></a>

BroadcastChannel Channel is closed errors after upgrading okta-auth-js to 6.4.0 (fixed in 6.7) | Vectle