You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running a NextJS app using "App Routing" in a Firebase emulator, it doesn't handle 404 page generation properly. The default NextJS 404 page generates a "This page could not be found" error styled in the middle of the page. When running in Firebase Emulator suite, the 404 page generates as . This makes it impossible to test custom 404 page appearances for a NextJS application within the Firebase emulator.
Thanks for the detailed report, @MidnightLightning! I was able to reproduce the behavior you mentioned. From what I can gather, the issue only occurs on the emulator. When deploying the app to Firebase Hosting, accessing "https://<SITE_ID>.web.app/foobarbaz" shows the Next.js 404 page.
I'll raise this to our engineering team and mark this as reproducible.
Agreed @aalej, this is a bug with the Emulator Suite, not with Firebase overall. A production deploy of a NextJS app using the webframeworks experiment handles 404 pages appropriately; I've only seen this issue in how the Emulator Suite mocks that functionality for local development.
When running a NextJS app using "App Routing" in a Firebase emulator, it doesn't handle 404 page generation properly. The default NextJS 404 page generates a "This page could not be found" error styled in the middle of the page. When running in Firebase Emulator suite, the 404 page generates as . This makes it impossible to test custom 404 page appearances for a NextJS application within the Firebase emulator.
[REQUIRED] Environment info
firebase-tools: 13.24.2
Platform: Docker running inside macOS
[REQUIRED] Test case
https://gitlab.com/MidnightLightning/firebase-404-test
[REQUIRED] Steps to reproduce
Run
docker compose up
, then visithttp://localhost:25602/foobarbaz
.[REQUIRED] Expected behavior
To see the NextJS custom 404 page (text "This page could not be found" in the center of screen)
[REQUIRED] Actual behavior
A plain textual response of "Cannot GET /pathname"
The text was updated successfully, but these errors were encountered: