Duolith docs

Errors E0200 to E0299

E0287 Package uses a browser-only API

Message package uses feature, which exists only on the web

Words in italics are filled in when the compiler reports it, such as the element's name or the list of known ones.

Why

duolith scan found the DOM or another browser API, such as document, window, localStorage or MutationObserver, used outside a typeof guard. It works in the web build, but iOS and Android draw with native views and have no DOM, so the package is web-only.

How to fix it

Use the package only in code that runs on the web, or choose one that does not touch the DOM; for storage and the like, use Duolith's own state and effects.

In a terminal

duolith explain E0287

Mentioned in