Node DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
See original GitHub issueDescribe the bug
A depreciation warning about Buffer()
is shown when a pdf has been rendered. In the future Node
versions, Buffer()
will be removed. Which will broke the rendering process.
To Reproduce
Have Node
v10.15.3
or more.
- Render a new pdf.
- Open the browser console.
- See the warning.
Screenshots
Desktop:
- OS: Windows
- Browser: Chromium (Electron)
- @react-pdf/renderer: 1.5.4,
- @react-pdf/styled-components: 1.4.0
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Buffer() is deprecated due to security and usability issues ...
According to the deprecation warning new Buffer() should be replaced with one of: Buffer.alloc(); Buffer.allocUnsafe() or; Buffer.from().
Read more >Porting to the Buffer.from() / Buffer.alloc() API - Node.js
The migration fixes the following deprecation warning: The Buffer() and new Buffer() constructors are not recommended for use due to security and usability...
Read more >[BUG]: DeprecationWarning: Buffer() is deprecated due to ...
allocUnsafe(), or Buffer.from() methods instead. (Use ... DeprecationWarning: Buffer() is deprecated due to security and usability issues.
Read more >Getting (node:3524) [DEP0005] DeprecationWarning: Buffer ...
(node:3524) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe() ...
Read more >Avoid using Buffer deprecated APIs | CAST Appmarq
Using deprecated Node.js API could lead to security compliancy issues. The Buffer() function and new Buffer() constructor are deprecated due to API ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’d be willing to solve this issue myself in a near future.
@joernroeder See https://github.com/react-pdf/fontkit/pull/6#issuecomment-494450210