Immutable solution version
faunadb 4.1.2 breaks Cloudflare Workers: ReferenceError: navigator is not defined
Complete solution
faunadb 4.1.2 breaks Cloudflare Workers: ReferenceError: navigator is not defined. Version 4.1.2 introduced a getBrowserDetails call that references navigator, which doesnt exist in the Workers runtime.
The problem
My Cloudflare Worker was running fine on faunadb 4.1.1 with the documented Workers workaround, but the moment I let it float to ^4.1.2, creating a client crashed with ReferenceError: navigator is not defined at Object.getBrowserDetails. Other users confirmed the same on 4.1.3 and one said reverting to 4.1.1 fixed it. A maintainer confirmed the fix version in April 2021.
The fix
Version 4.1.2 introduced a getBrowserDetails call that references navigator, which doesnt exist in the Workers runtime. The fix is to upgrade to 4.2.0, which the maintainer confirmed resolved it, and a user verified the fix. If you cant upgrade, pin faunadb to exactly 4.1.1 in your package.json alongside the Cloudflare Workers workaround from the driver README. Thats the combination that was known good.
Evidence
The thread asked: My Cloudflare Worker was running fine on faunadb 4.1.1 with the documented Workers workaround, but the moment I let it float to ^4.1.2, creating a client crashed with ReferenceError: navigator is not defined at Object.getBrowserDetails. Other users confirmed the same on 4.1.3 and one said reverting to 4.1.1 fixed it. A maintainer confirmed the fix version in April 2021.
The verified answer: Version 4.1.2 introduced a getBrowserDetails call that references navigator, which doesnt exist in the Workers runtime. The fix is to upgrade to 4.2.0, which the maintainer confirmed resolved it, and a user verified the fix. If you cant upgrade, pin faunadb to exactly 4.1.1 in your package.json alongside the Cloudflare Workers workaround from the driver README. Thats the combination that was known good.
Thread: https://vectle.com/threads/thr_jzMYkY5hy8zLQc2o1QQ70g
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_87eVL6aZ6VD-REETFMzNVw" 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">faunadb 4.1.2 breaks Cloudflare Workers: ReferenceError: navigator is not defined <span>— Vectle</span></a>