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

DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. #1048

Closed
zhex900 opened this issue Sep 11, 2021 · 6 comments · Fixed by #1285
Labels
released This issue/pull request has been released.

Comments

@zhex900
Copy link

zhex900 commented Sep 11, 2021

"jimp": "^0.16.1",

error:

DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
    at showFlaggedDeprecation (buffer.js:194:11)
    at new Buffer (buffer.js:281:3)
    at module.exports.Parser._parseChunkBegin (/Users/jake/Code/pam-kiosk-app/.webpack/main/index.js:147371:19)
    at module.exports.SyncReader.process (/Users/jake/Code/pam-kiosk-app/.webpack/main/index.js:148011:17)
    at module.exports (/Users/jake/Code/pam-kiosk-app/.webpack/main/index.js:147238:10)
    at Object.exports.read [as image/png] (/Users/jake/Code/pam-kiosk-app/.webpack/main/index.js:147604:10)
    at Jimp.parseBitmap (/Users/jake/Code/pam-kiosk-app/.webpack/main/index.js:49151:53)
    at Jimp.parseBitmap (/Users/jake/Code/pam-kiosk-app/.webpack/main/index.js:47837:32)
    at new Jimp (/Users/jake/Code/pam-kiosk-app/.webpack/main/index.js:47790:13)
    at _construct (/Users/jake/Code/pam-kiosk-app/.webpack/main/index.js:46325:21) {

  const image = await Jimp.read(Electron.NativeImage.toPNG());

Does anyone know how to solve this?

@philiprenich
Copy link

It seems like this is coming from a dependency called "load-bmfont" according to this issue: #662

The problem was fixed in that repo, but no release has been tagged yet for Jimp to pick up, though I did notice this PR to just remove the dependency.

@philiprenich
Copy link

Whoops, apologise, it seems there was a new release, 1.4.1 Experience-Monks/load-bmfont#7 so it probably isn't that. Could be any number of dependencies then. Looks like pngjs had it as well. pngjs/pngjs#134 Seems like that was fixed in a later version than Jimp depends on though which could be where this error stems from.

@hipstersmoothie
Copy link
Collaborator

This might be fixed. Would anyone here mind checking?

@DTCleanBrain
Copy link

@hipstersmoothie As of 2/13/23 running Jimp 0.22.4 inside of a Node 16 Lambda I am still getting the warning about Buffer Deprecation

@bdwellons
Copy link

Seeing the same issue. 0.22.10 inside Node 18.x Lambda. Buffer deprecation. Any work around?

@hipstersmoothie
Copy link
Collaborator

🚀 Issue was released in v1.0.2 🚀

@hipstersmoothie hipstersmoothie added the released This issue/pull request has been released. label Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants