My current app structrue is:
app
│ not-found.tsx
└───form
│ loading.tsx (A)
├───@header
│ │ default.tsx
│ │ loading.tsx (B)
│ └───active
│ loading.tsx (C)
│ page.tsx
├───active
│ loading.tsx (A)
│ page.tsx
├───begin
│ page.tsx
└───complete
page.tsx
The header slot is, of course, a header shown at the top of the page. It has 2 variants, a BaseHeader, which has a drop down to change the language, and then a FormHeader which is the main header for the form and includes a progress bar and nav bar. The FormHeader also has 2 variants of its own, loading and loaded specified by a state prop. This (wip) adds skeletons in place of the text in the nav bar.
The loading.tsx version A just displays a loading spinner. Version B displays the BaseHeader while loading, and version C displays the FormHeader with state="loading".
I would expect, according to the next documentation, for either header to be shown in its loading state as the slot would refer to the loading.tsx closest to it. However, it instead refers to the loading.tsx of /form and displays a loading spinner in place of the header. My first question is, am I expecting behaviour that's actually incorrect? Or am I doing something wrong?
The next thing I noticed on a similar topic is that by navigating to the 404 page, which includes a link back to the beginning of the form:
<Link href="/form/begin" className="underline">
Return To Form
</Link>
and then clicking this link, it will take me back but it won't load the css module for the header. There are no 40x/50x errors in the network tab, it just doesn't even try to load the css. Refreshing fixes it.
I have a feeling this is related, and so I'm also wondering, what could be cauing this?