Recipes

Single-Page Applications

By default, Unlighthouse assumes SSR pages with links in initial HTML. SPAs require JavaScript execution for link discovery.

Enable JavaScript Execution

Allow Puppeteer to execute JavaScript before extracting page content:

import { defineUnlighthouseConfig } from 'unlighthouse/config'

export default defineUnlighthouseConfig({
  scanner: {
    skipJavascript: false, // Enable JS execution for SPAs
  },
})
Enabling JavaScript execution increases scan time but is necessary for accurate SPA scanning.
Did this page help you?