Skip to content

Commit fd1e5e7

Browse files
robhoganfacebook-github-bot
authored andcommitted
Inspector proxy: Fix "Buffer() is deprecated" warning (#43686)
Summary: Pull Request resolved: #43686 Under Node 20, the use of `new Buffer(string)` is deprecated and logs a warning. This replaces it with the recommended `Buffer.from(string)`. Changelog: [General][Fixed] FIx "Buffer() is deprecated" warning from debugger proxy. Reviewed By: huntie Differential Revision: D55472025 fbshipit-source-id: 8b5af9e2d7e026cbdf6aa68f71ff0f856fb164db
1 parent 164815a commit fd1e5e7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • packages/dev-middleware/src/inspector-proxy

packages/dev-middleware/src/inspector-proxy/Device.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ export default class Device {
631631
// $FlowFixMe[cannot-write]
632632
payload.params.sourceMapURL =
633633
'data:application/json;charset=utf-8;base64,' +
634-
new Buffer(sourceMap).toString('base64');
634+
Buffer.from(sourceMap).toString('base64');
635635
} catch (exception) {
636636
this.#sendErrorToDebugger(
637637
`Failed to fetch source map ${params.sourceMapURL}: ${exception.message}`,

0 commit comments

Comments
 (0)