Session: DeprecationWarning in node.js v7.0.0

Created on 27 Oct 2016  路  5Comments  路  Source: expressjs/session

when i use nodejs v7.0.0 and use this package and i use session store
i get the error:

DeprecationWarning: Using Buffer without new will soon stop working. Use new Buffer(), or preferably Buffer.from(), Buffer.allocUnsafe() or Buffer.alloc() instead.

how fix ??

bug deps

All 5 comments

Hi @c941010623 this module hasn't been updated yet to really support Node.js 7.x (since it just arrived a few days ago), so thanks for making us aware of this new deprecation! You can add --no-deprecation to your Node.js command line arguments to suppress the warning until we release an update.

Hi @c941010623 the only place in the code we are using the Buffer constructor is here: https://github.com/expressjs/session/blob/8e57b21bef0d53010c4d37f4beee3f0341f3eaa6/index.js#L284

That line is using new, so I'm not sure what you are seeing. Can you tell me from which line that deprecation warning is coming from for where we need to fix?

Ah, found it: it comes from our dependency crc. Someone will need to file an issue at https://github.com/alexgorbatchev/node-crc and we can upgrade it when a new version is published.

haha, nevermind! The PR https://github.com/alexgorbatchev/node-crc/pull/44 was submitted to that module and merged not too long ago. Now we wait for a npm release :)

thank you very much ^^

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yolapop picture yolapop  路  3Comments

UnderTheMoonspell picture UnderTheMoonspell  路  3Comments

janithapm picture janithapm  路  4Comments

brimsey picture brimsey  路  3Comments

mjquito picture mjquito  路  4Comments