Browser-sync: [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated when Browsersync: Connected

Created on 8 May 2019  ·  15Comments  ·  Source: BrowserSync/browser-sync

Issue details

As soon as I connect to the server (localhost:3000) I received the following message:
(node:37943) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated

Steps to reproduce/test case

Use node, npm and gulp as indicated below. All the tasks load properly, but when connected with browser-sync at localhost:3000 node sends the DEP0066 message and it stops working.

Please specify which version of Browsersync, node and npm you're running

  • Browsersync [ 2.26.5 ]
  • Node [ 12.1.0 ]
  • Npm [ 6.9.0 ]

Affected platforms

  • [ ] linux
  • [ ] windows
  • [X] OS X
  • [ ] freebsd
  • [ ] solaris
  • [ ] other _(please specify which)_

Browsersync use-case

  • [ ] API
  • [X] Gulp
  • [ ] Grunt
  • [ ] CLI

for all other use-cases, (gulp, grunt etc), please show us exactly how you're using Browsersync

function browsersync(){
  browserSync.init( {
    proxy: projectURL,
    open: false,
    injectChanges: true,
  } );
};

gulp.task( 'default', gulp.series(styles, php, phpDIST, vendorsJS, customJS, images, browsersync, watchTask));

Most helpful comment

Fixed by updating "browser-sync": "^2.26.7".

All 15 comments

I have the same problem

Hey @suhailkc I had to downgrade to node 10.15.3 LTS to solve it.

It's just a warning, so it seems we can ignore it for now. But it'd be nice if this was fixed at some point @shakyShane :)

I have the same problem,what is the solution?

You ignore the warning, or wait, or use Node.js < 12.x.

thanks!

for the record, the DEP0066 message does appear but reloading continues to work, I'm able to use node 12.3.0 to run browser-sync 2.26.5.

Screen Shot 2019-05-26 at 11 08 48

Original post implies "it stops working" but I can see things refreshing on my machine! I'm using Gulp and browserSync mostly copy-pasted from official examples, the .pipe(browserSync.stream()); and all.

I'm not denying existence of your issue, I'm saying maybe something is wired up not the right way if refreshing is not happening?

Either way, I hope the API will be updated soon and DEP0066 error will disappear. 👍

Same warning on browserSync 2.26.5 with node 12.3.1 on windows platform.

Same warning using browserSync 2.26.5 with node 12.4.0 on macOS 10.14.5

Fixed by updating "browser-sync": "^2.26.7".

For someone who came here for solution:
Issue may be fixed with upgrading express package to v4.17.1 (we are on node 12.13.0)

I'm working with express v4.17.1 and node 12.13.1 and for me the problem is still present

Same is the case for me : express v4.17.1 and node 12.13.1 . What is the solution?

If you come here from Google, you can fix them by upgrade express to version 4.17.1 then an error has gone.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

danielverejan picture danielverejan  ·  3Comments

adjavaherian picture adjavaherian  ·  4Comments

npearson72 picture npearson72  ·  3Comments

Hurtak picture Hurtak  ·  3Comments

pensierinmusica picture pensierinmusica  ·  4Comments