Skip to content

UNSAFE_EVAL: eval in the component

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

The component calls or references eval, which runs a string as code in the host page. Whoever controls the string (an attribute of the page, an API answer, what the visitor types) runs code with the page’s privileges, so the static security check refuses it (rule eval).

Remove eval: parse data with JSON.parse, compute with ordinary functions, and map the cases you need to functions in an object.