UNSAFE_EVAL: eval in the component
| Severity | Fault | Stage |
|---|---|---|
| error | customer (the source package) | build output |
What it means
Section titled “What it means”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).
How to fix
Section titled “How to fix”Remove eval: parse data with JSON.parse, compute with ordinary functions, and map the cases you need to functions in an object.