Open
Description
Link to the code that reproduces this issue
https://github.com/heymath/nextjs-bug-not-found-demo
To Reproduce
- start the app of the demo repo
- go on http://localhost:3000/test/?notFound=1
- you get a runtime error "TypeError: Cannot read properties of undefined (reading 'entryCSSFiles')"
Current vs. Expected behavior
Right now you get an Runtime Error "TypeError: Cannot read properties of undefined (reading 'entryCSSFiles')"
instead of seeing a NotFound page.
Four our production app it results in a blank page "Internal server error"
Provide environment information
Operating System:
Platform: linux
Arch: x64
Version: #31~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Aug 16 13:45:26 UTC 2
Available memory (MB): 15705
Available CPU cores: 16
Binaries:
Node: 22.12.0
npm: 10.9.0
Yarn: N/A
pnpm: N/A
Relevant Packages:
next: 15.2.0 // Latest available version is detected (15.2.0).
eslint-config-next: 15.2.0
react: 19.0.0
react-dom: 19.0.0
typescript: 5.7.3
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Error Handling
Which stage(s) are affected? (Select all that apply)
next dev (local), next start (local)
Additional context
Demo repository with Next.js v15.2
, we have the same bug in production with v15.1
.
I was able to reproduce our bug when combining pageExtensions
+ trailingSlash
in next.config.ts
so I limited the Demo repository to this setup and the use of PagesRouter + AppRouter because we are using both in our production App.
Note
Edit: I realized that the bug is only cause by the pageExtensions config actually.