Nuxt 4 - Prerendered routes still cause a server function invocation

Example site: https://helpful-choux-0def3a.netlify.app
Repo: GitHub - dgrayvold/netlify-nuxt-4-tests

In the example site there are two routes (/ and /test) that are both set to be prerendered through nuxt.config.ts’s routeRules property. However, when navigating to the routes on the deployed site, I can see in my function logs that both cause invocations of the server handler function. The load times of the pages generally feel longer than I’d expect for simple HTML as well, hinting that the functions are running before serving them.

In this blog post it’s stated that:

  • Nuxt hybrid rendering (AKA route rules) now fully works out of the box: for example, set "/blog/**": {prerender: true} in your Nuxt config’s routeRules and those pages will be prerendered at build time and excluded from function invocations.

I have future: { compatibilityVersion: 4 } and compatibilityDate: 2025-03-29 set in the config as mentioned in the post as well. Is there some other piece I’m missing to get it to work?

Thanks in advance!

I can confirm loading / as well as /test doesn’t invoke Lambda on your site.

@hrishikesh thanks for the response. However, unless I’m misunderstanding something I’m seeing the opposite on my end. Looking at the logs for the function, I’m able to see an invocation for visiting one of the pages just now, as well as the invocations presumably from the time of your check earlier today:

In the functions metrics for the site I’m also seeing invocations for those two timeframes. (Not able to add a screenshot for that here as I’m a new member.)

Can you clarify what those are if not ‘real’ invocations, and if that’s the case how I can determine if an actual invocation happened?

How do you know that’s for / and/or /test?