Skip to content

UNSAFE_GLOBAL_ACCESS: Computed access to a global object

Severity Fault Stage
error customer (the source package) build output

The component reads a property of window, globalThis, self, document or a function by a name computed at run time (window[name]), or passes the global object, document or the runtime’s Preact module around as a value (to a function, in an object or array, returned), so the build cannot tell which global it reaches, such as eval or document.cookie (rule dynamic-global-access).

Name the global directly (window.innerWidth) or keep your own object with the values you need.