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

DeprecationWarning for OutgoingMessage.prototype._headers

Open rgladwell opened this issue 6 years ago • 34 comments

Accessing the HTTP server throws a DeprecationWarning for OutgoingMessage.prototype._headers on Node version 12.3.1.

const puppeteer = require('puppeteer')
const httpServer = require('http-server')
const server = httpServer.createServer({ root: 'dist/html/' })
server.listen(8080)

const browser = await puppeteer.launch({
  headless: true,
  args: ['--no-sandbox', '--disable-setuid-sandbox']
})

const page = await browser.newPage()
await page.goto('http://localhost:8080', { waitUntil: 'networkidle0' })

What did you expect to happen?

No deprecation warning.

What actually happened?

Got the following warning:

(node:59243) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated

If the issue is a feature request, what is the motivation / use case for it?

Tell us about your environment

  • http-server version: 0.11.1
  • Platform: Mac (Node 10.14.5 12.3.1)

rgladwell avatar Jun 03 '19 08:06 rgladwell

https://github.com/flatiron/union/pull/64

Xmader avatar Jun 05 '19 02:06 Xmader

The same occurs when using http-server from the command line. I wonder if this could be resolved?

Smilebags avatar Jun 13 '19 10:06 Smilebags

I am having the same problem when running http-server (local).

I have a simple angular app: 1 - ng build --prod 2 - go to dist/{name-app} 3 - run http-server

when browsing the url i get the following error:

image

image

Lemraj avatar Oct 21 '19 18:10 Lemraj

This is an issue in union (flatiron/union#64) which we're planning to remove from http-server down the road (#483). I'm not going to close this issue though, to ensure we make sure it goes away after #483 is resolved.

thornjad avatar Oct 23 '19 22:10 thornjad

node -v 10.x is solved. thanks

gnganapath avatar Apr 16 '20 07:04 gnganapath

Is there an ETA when this will be resolved?

rsail avatar Oct 13 '20 00:10 rsail

Continuing @rsail 's comment: ... and what can we do in the meanwhile (as a quick hotfix)? [EDIT] I found a similar tool called serve, I hope this helps.

stoufa avatar Dec 26 '20 21:12 stoufa

Always the problem with very latest build (April 2021). An estimated ETA or fix would be greatly appreciated

jmcollin78 avatar Apr 28 '21 19:04 jmcollin78

Over 2 years now. How much longer until this is fixed?

Dragonrun1 avatar Jun 10 '21 07:06 Dragonrun1

I was running another server on same port (using XAMPP server). I stopped XAMPP and restarted my cmd and its working now.

Saqib92 avatar Jun 30 '21 12:06 Saqib92

Still the bug alive? or it is solved?

rich1n avatar Oct 01 '21 00:10 rich1n

This is an upstream bug in the dependency union, which is more or less unmaintained. #483 seeks to remove it, but it will take some substantial work. For the time being, I'm not aware of plans to imminently remove the _headers property in Node, so we're not at a crisis point yet. I may not have the time to get to #483 for a while, and would welcome any PRs.

thornjad avatar Oct 01 '21 02:10 thornjad

This issue has been inactive for 180 days

github-actions[bot] avatar Mar 30 '22 12:03 github-actions[bot]

Still happening

spacecowgoesmoo avatar Apr 29 '22 22:04 spacecowgoesmoo

Can't believe it's now 2022 and the bug still exists... Orz

ssaakkiii avatar May 10 '22 08:05 ssaakkiii

I have met the same error

Eli250 avatar May 10 '22 20:05 Eli250

+1

imad-dh avatar May 18 '22 12:05 imad-dh

+2

pingan8787 avatar May 24 '22 08:05 pingan8787

+3

shinelp100 avatar May 31 '22 09:05 shinelp100

Any updates on this?

Zwiqler94 avatar Oct 23 '22 04:10 Zwiqler94

Might be useful to spin a new version of union fixing just this…?

mirabilos avatar Nov 10 '22 20:11 mirabilos

This issue is still not fixed yet!!

Jaystar-Bee avatar Nov 25 '22 16:11 Jaystar-Bee

Is there any solution for this?

JobinZe avatar Dec 02 '22 22:12 JobinZe

Howdy, still not fixed

kburns2kb avatar Jan 19 '23 15:01 kburns2kb

same problem

MarwenLabidi avatar Feb 09 '23 10:02 MarwenLabidi

Same problem on Nx monorepo with node v19.7.0

omarzougui avatar Mar 13 '23 12:03 omarzougui

Another passer-by surprised by this bug. Was looking for a small Node static web server to run a static site so I can Playwright tests against it during development/CI. This project seems to fit the bill, but this warning is unfortunate.

jaanus avatar Mar 20 '23 09:03 jaanus

same problem.

akadori avatar May 25 '23 08:05 akadori

Same here

work933k avatar Jun 13 '23 10:06 work933k

Same with node v18.15.0 :( Screenshot_9081788a87c

eldritchT avatar Jun 21 '23 13:06 eldritchT