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

Hosting Emulator: Geting 404 error page instead of index.html #5133

Closed
ASHHAD-BASE opened this issue Oct 16, 2022 · 8 comments · Fixed by #5389
Closed

Hosting Emulator: Geting 404 error page instead of index.html #5133

ASHHAD-BASE opened this issue Oct 16, 2022 · 8 comments · Fixed by #5389
Assignees

Comments

@ASHHAD-BASE
Copy link

I have recently updated firebase tools by npm update -g firebase-tools
and the expected hosting emulator behavior has changed.
I am getting 404 page instead of index.html.

Expected behavior

when accessing localhost:5000 I should get localhost:5000/index.html
but i am getting 404 not found page
also I am getting localhost:5000/index.html when using url localhost:5000/index.html.

To Reproduce

I have tried installing emulator suite from scratch on another machine
and still getting 404 not found page instead of index.html
so this bug may have been introduced in new versions of firebase-tools

OS: windows
Browser :n/a
firebase-tools Version :11.14.4

@Frankellyguzman
Copy link

I am having the same issue, were you able to figure it out?

@Ulyssedev
Copy link

I'm also having this issue, I'm still trying to figure out why.

@bkendall
Copy link
Contributor

bkendall commented Oct 17, 2022

Can y'all give me a minimal reproducible example for this? I've done init hosting with rewrites, without rewrites, but I've been unable to reproduce this issue.

edit: I'm also curious that you're on Windows - I wonder if that matters? Anyone else seeing this on other platforms?

@bkendall bkendall added the Needs: Author Feedback Issues awaiting author feedback label Oct 17, 2022
@Ulyssedev
Copy link

Ulyssedev commented Oct 17, 2022

https://github.com/TheLowHigh/Firebase404

edit : I am currently running on Windows 11

@bkendall
Copy link
Contributor

bkendall commented Oct 17, 2022

With your Firebase404 repo, running on macOS (seems to be correct - not reflecting the issue here):

~ » curl -I http://localhost:5004
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Content-Length: 318
ETag: 0dbe35bef73e03f6689c1719f365f752
Last-Modified: Mon, 17 Oct 2022 19:25:49 GMT
Vary: Accept-Encoding
Date: Mon, 17 Oct 2022 19:26:43 GMT
Connection: keep-alive
Keep-Alive: timeout=5

~ » curl -I http://localhost:5004/index.html
HTTP/1.1 301 Moved Permanently
Location: /
Content-Type: text/html; charset=utf-8
Date: Mon, 17 Oct 2022 19:26:53 GMT
Connection: keep-alive
Keep-Alive: timeout=5

I've got a windows machine behind me - looks like I'm giving that a whirl.

@Ulyssedev
Copy link

Just installed wsl and debian and everything is working, I belive this might be a windows only issue

@bkendall
Copy link
Contributor

yup! opened up the windows machine and I get a 404 page on / (but a 301 on /index.html, which is correct with cleanURLs).

When I remove cleanURLs, I get different behavior. It returns the 404 page on / and /index.html works (200).

I may copy this issue over to superstatic since that's where the issue will be, but this is definitely a weird one.

@HuskerSam
Copy link

this works now! thanks!

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

Successfully merging a pull request may close this issue.

6 participants