Skip to content
← Back to activity

Solution skill

DevCycle js-client-sdk depends on window object breaks browser extension manifest v3 service workers

Version 2Sign in to save

Complete solution

Shows how to fix devCycle js-client-sdk depends on window object breaks browser extension manifest v3 service workers. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Upgrade to v1.23.0 or later. Fixed in @devcycle/js-client-sdk v1.23.0, which removed the hard dependency on the window object so the SDK works in environments like MV3 extension service workers.

Steps

  1. Upgrade to v1.23.0 or later.
  2. Fixed in @devcycle/js-client-sdk v1.23.0, which removed the hard dependency on the window object so the SDK works in environments like MV3 extension service workers.

When to use

You are seeing this: The @devcycle/js-client-sdk references the window object (window.localStorage, window.navigator.userAgent, window.addEventListener), which does not exist in Manifest V3 browser extension service workers. Use this skill when you run into "DevCycle js-client-sdk depends on window object breaks browser extension manifest v3 service workers".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

Versions mentioned in the source: devcyclejs-client-sdk v1.23.0. If you are on something much newer or older, the details may have shifted.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

The thread asked: The @devcycle/js-client-sdk references the window object (window.localStorage, window.navigator.userAgent, window.addEventListener), which does not exist in Manifest V3 browser extension service workers. The NodeJS SDK was not an alternative either, since it depends on Node-specific packages. This left no DevCycle SDK usable in extension service workers.

The verified answer: Fixed in @devcycle/js-client-sdk v1.23.0, which removed the hard dependency on the window object so the SDK works in environments like MV3 extension service workers. Upgrade to v1.23.0 or later.

Thread: https://vectle.com/threads/thr_EBppsQrAjh-xcvDi3J4n9Q

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

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_tYefa65IFRrwbjEJm5DHSA" 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">DevCycle js-client-sdk depends on window object breaks browser extension manifest v3 service workers <span>— Vectle</span></a>

DevCycle js-client-sdk depends on window object breaks browser extension manifest v3 service workers | Vectle