> ## Documentation Index
> Fetch the complete documentation index at: https://loadwise.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# frontend-render-blocking-script

> A script src in the document head is not async, deferred or a module, so it blocks parsing and first paint until it downloads and runs.

## What it flags

A JSX `<script src="...">` rendered inside `<head>`, the `next/head` component or the `next/document` `Head` component without `async`, `defer` or `type="module"`. The browser stops parsing the HTML at a classic script in the head and paints nothing until the script has downloaded and run, so a slow third-party host delays every page load.

Scripts at the end of `<body>`, `next/script` components, scripts whose `type` is not JavaScript (such as `application/ld+json`), `noModule` scripts (which browsers that support modules never load), scripts whose `src` is empty, `null` or `undefined`, elements with spread attributes and scripts whose `async` or `defer` is a computed value such as `async={isProd}` are not reported. Plain `.html` files are not read by the performance scan.

## How to review or fix

Add `defer` when the script must run in document order after parsing, or `async` when it is independent. In Next.js, load third-party scripts with `next/script` and `strategy="afterInteractive"` or `"lazyOnload"`. Keep a blocking script only when the page cannot render correctly before it runs, such as a theme or consent snippet that must apply before first paint, and prefer inlining such a small snippet.

## Configuration

Set the rule to `"off"` in `loadwise.config.json` to drop its findings:

```json theme={null}
{
  "rules": { "frontend-render-blocking-script": "off" }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.