mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
### What When using a default slot that re-exports another page, the CSS entries (and presumably other client reference modules, like JS entries) that correspond with the re-exported page won't be loaded, resulting in CSS styles not being applied. ### Why `next-app-loader` constructs the path to the default segment but special cases the `children` slot (which is used as the page), to mark the segment as an empty string. This is so that the parallel default file can be loaded. However the way that `defaultPath` is constructed, it assumes that `actualSegment` won't be an empty string, and constructs an invalid path like so: `app/example//default.tsx` When we go to look up the JS/CSS entries from the client reference manifest, the key will be incorrect and so it won't find the files for it, resulting in this bug. ### How This moves the `/` delimiting to be part of the creation of the `actualSegment` variable so that we only append it when we know we aren't setting it to be an empty string. Fixes #52245 Fixes #49871 Closes NEXT-2309 Closes NEXT-2310
17 lines
321 B
TypeScript
17 lines
321 B
TypeScript
import Link from 'next/link'
|
|
import styles from './page.module.css'
|
|
|
|
export default function Example() {
|
|
return (
|
|
<div>
|
|
<h1>Example</h1>
|
|
<p className={styles.red} id="red-text">
|
|
This is red
|
|
</p>
|
|
<p>
|
|
<Link href="/default-css/more">Show more</Link>
|
|
</p>
|
|
</div>
|
|
)
|
|
}
|