[Bug] New shortcodes not detected until hugo server restart

I have noticed a certain 'bug` with shortcodes in the recent few Hugo versions. I create a shortcode, then add it to a page, but an error pops up.

Source changed /posts/post-3/index.md
ERROR Rebuild failed: process: "/home/tifenak/hugo/test/content/posts/post-3/index.md:12:1":failed to extract shortcode: template for shortcode "year" not found

Steps to reproduce

  1. Create a dummy hugo site
hugo new theme quicksite --themesDir .
cd quicksite
hugo server
  1. Create a shortcode layouts/_shortcodes/year.html
{{- now.Format "2006" -}}
  1. Add the shortcode to a content page
This is {{< year >}}, and look at how far we've come.
  1. Check your terminal. The error mentioned prior shows up. Restarting the site makes it go away.
hugo v0.152.2-6abdacad3f3fe944ea42177844469139e81feda6+extended linux/amd64 BuildDate=2025-10-24T15:31:49Z VendorInfo=gohugoio
GOOS="linux"
GOARCH="amd64"
GOVERSION="go1.25.3"
github.com/sass/libsass="3.6.6"
github.com/webmproject/libwebp="v1.3.2"