Skip to content

UNSAFE_SCRIPT_ELEMENT: Component creates a script element

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

The component creates a <script> element (createElement(‘script’), or a tag name built at run time), which loads and runs code from outside the published bundle in the host page (rule external-script).

Import the code you need as an allowlisted package so it is bundled and checked; create elements with JSX or with a literal tag name.