Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webframeworks experiment 404 handling incorrect #8035

Open
MidnightLightning opened this issue Dec 5, 2024 · 2 comments
Open

webframeworks experiment 404 handling incorrect #8035

MidnightLightning opened this issue Dec 5, 2024 · 2 comments

Comments

@MidnightLightning
Copy link

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 visit http://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"

@aalej
Copy link
Contributor

aalej commented Dec 10, 2024

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.

@MidnightLightning
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants