Skip to content

fix(rules): a slow synchronous script in the home page head is not reported by any render-blocking or request-chain rule #1751

Closed

Description

@nc9

Fault slow-blocking-script on the public demo site nutshop.squirrelscan.com (repo squirrelscan/nut-shop): the home page head contains <script src="/_fault/slow.js"> (synchronous, no async or defer; the file answers after 2.5 s, confirmed with curl: HTTP 200, 2.54 s). Run 01M759PV7TNEQDYXMRQS4HWTA3 (report 01M759TWS40YBSXAQJFJ2M1R8K, level full, 71 pages) does not mention /_fault/slow.js anywhere (grep of the published report JSON: 0 matches). perf/render-blocking is status info "1 render-blocking resource(s) (+69 more pages)" and lists only the stylesheet /assets/styles-D0apTJgR.css; perf/critical-request-chains lists only the same CSS. In run 01M757TPD9XB453C5MNP5M29HV the chain rule did list another script (JS: /_fault/shop-config.js), so scripts are not ignored in general.

Acceptance Criteria

  • A synchronous script in <head> with no async or defer is listed by perf/render-blocking with its URL and page.
  • A render-blocking script is reported with its measured time, at warning or higher, when it takes more than 1 s from an already-connected host or more than 2 s as the first request to its host (cold connection). (Amended by the maintainer: the 2 s cold threshold is what shipped in v0.0.179.)
  • A fixture with a slow synchronous head script asserts the finding.

Activity

  1. added
    bug
    size: M
    rules
    on Nov 11, 2026
  2. added theissue type on Nov 11, 2026
  3. added
    performance
    on Nov 11, 2026
  4. nc9 commented on Nov 11, 2026

    @nc9
    ContributorAuthor

    Update from a later audit of the same fault: this time the script was reported, so the scope here narrows.

    Run 01M765CGEC3GA0H37GRZCMM0DW: perf/critical-request-chains warns with item JS: /_fault/slow.js on /, and perf/render-blocking (info, "2 render-blocking resource(s)") lists it too. The earlier miss fits #1769: the site's client code removes head scripts after hydration, and whether the snapshot still has them depends on timing.

    What is still wrong once #1769 is fixed:

    • The script takes 2.5 s to answer (curl: HTTP 200, 2.54 s). No finding states a time. A synchronous head script that delays first render by seconds reads the same as one that answers in 20 ms.
    • perf/render-blocking stays at info for it.

    Revised acceptance criteria for this issue:

    • A synchronous script in the head whose response time is over a stated threshold is reported at warning or above, with the measured time and the page.
    • The finding names the script and says it blocks rendering for that long; a fast synchronous script keeps today's level.
    • When response times were not measured for the audit (no render, or timing unavailable), the rule says so instead of passing.
    • Detection of the script itself is covered by Rendered audits miss scripts the server HTML references when client code removes them after hydration #1769 and is not repeated here.

    nik

  5. nc9 commented on Nov 12, 2026

    @nc9
    ContributorAuthor

    Not closed after v0.0.179 (https://github.com/squirrelscan/squirrelscan/releases/tag/v0.0.179). A slow synchronous head script is listed and warned, but a first-of-host script is reported only above 2 s (1 s from a warm host), so a cold 1 to 2 s script is not reported. Needs a maintainer call: amend the criterion or report the cold script. The change that shipped is bc2e972.

    nik

  6. nc9 commented on Nov 12, 2026

    @nc9
    ContributorAuthor

    Shipped in v0.0.179 (https://github.com/squirrelscan/squirrelscan/releases/tag/v0.0.179), commit bc2e972: perf/render-blocking lists a synchronous head script with its URL and page, and reports one with its measured time when it takes more than 1 s from an already-connected host, or more than 2 s as the first request to its host. Tests: render-blocking-slow-script-1751.test.ts and render-blocking-script-1751-e2e.test.ts. Criterion 2 is amended to the 2 s cold-connection threshold, as decided by the maintainer.

    nik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugperformancerulessize: M

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions