http-server icon indicating copy to clipboard operation
http-server copied to clipboard

Node 17 broke the catch all

Open Banou26 opened this issue 3 years ago • 5 comments

After installing node 17, the following 404 happens when trying to use the catch all, it worked fine under node 16

(node:21632) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
(Use `node --trace-deprecation ...` to show where the warning was created)
[2021-11-02T04:15:09.843Z]  "GET /foo" Error (404): "connect ECONNREFUSED ::1:1234"
[2021-11-02T04:15:09.843Z]  "GET /foo" Error (404): "Not found"
[2021-11-02T04:15:09.845Z]  "GET /foo" Error (404): "Not found"

Windows 10, node v17.0.1

Banou26 avatar Nov 02 '21 04:11 Banou26

Getting the same on 17 on OSX

jamescodesthings avatar Nov 02 '21 11:11 jamescodesthings

Could you provide the full details about your environment? Especially the exact command(s) used, the http-server version, and also in this case, it would be helpful to see the output you get on Node v16 for the exact same commands

thornjad avatar Dec 06 '21 21:12 thornjad

This issue has been inactive for 180 days

github-actions[bot] avatar Jun 05 '22 12:06 github-actions[bot]

The same issue here on Node 18!

Any dynamic URL (other than root) isn't served from the root. But it got a 404 error.

image


I started the server with:

npx http-server -p 3000 --proxy http://localhost:3000? ./build

It's OK on node 16.

mirismaili avatar Aug 14 '22 02:08 mirismaili

PSA: I ended up using sirv-cli with the --single flag as a workaround.

n8jadams avatar Jan 09 '23 22:01 n8jadams