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

[DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated #4976

Closed
khteh opened this issue Aug 22, 2022 · 1 comment
Closed

Comments

@khteh
Copy link

khteh commented Aug 22, 2022

Bump into the following deprecation warning in the following code snippet:

healthchecks.get('/live', function (req, res, next) {
  res.send('OK')
});
[nodejsrestapi-1] (node:1) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated 
[nodejsrestapi-1]     at ServerResponse.writeHead (/app/node_modules/spdy/lib/spdy/response.js:18:12) 
[nodejsrestapi-1]     at ServerResponse.writeHead (/app/node_modules/on-headers/index.js:44:26) 
[nodejsrestapi-1]     at ServerResponse.writeHead (/app/node_modules/on-headers/index.js:44:26) 
[nodejsrestapi-1]     at ServerResponse.writeHead (/app/node_modules/on-headers/index.js:44:26) 
[nodejsrestapi-1]     at ServerResponse._implicitHeader (node:_http_server:287:8) 
[nodejsrestapi-1]     at ServerResponse.end (/app/node_modules/compression/index.js:103:14) 
[nodejsrestapi-1]     at ServerResponse.send (/app/node_modules/express/lib/response.js:232:10) 
[nodejsrestapi-1]     at file:///app/src/webapi/routes/healthchecks.js:23:9 
[nodejsrestapi-1]     at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5) 
[nodejsrestapi-1]     at next (/app/node_modules/express/lib/router/route.js:144:13)

"express": "^4.18.1",
Node: v18.7.0

@dougwilson
Copy link
Contributor

dougwilson commented Aug 22, 2022

Hello, and sorry for your issue. It seems you may have opened the issue on the wrong module. According to your included stack trace, the spdy module is accessing the deprecated property, not the express module:

https://github.com/spdy-http2/node-spdy/blob/661b14a8db40a76a9a4842fc12ca8908f989cfd9/lib/spdy/response.js#L18

spdy-http2/node-spdy#382

spdy-http2/node-spdy#367

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

No branches or pull requests

2 participants