scalacenter / scalajs-bundler

https://scalacenter.github.io/scalajs-bundler
Other
234 stars 101 forks source link

nodejs Buffer deprecation warning #277

Open evbo opened 5 years ago

evbo commented 5 years ago

When running the static example with scalajs-bundler version 0.14.0 and scalajs version > 0.6.22 I see the following deprecation warning:

/scalajs-bundler-master/sbt-scalajs-bundler/src/sbt-test/sbt-scalajs-bundler/static$ sbt fastOptJS::webpack
[info] Bundling dependencies with source maps
[error] (node:27101) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[success] Total time: 26 s, completed Dec 27, 2018 4:35:23 PM

scalajs has an issue for this as well that looks resolved. Is there anything scalajs-bundler can do to help avoid that warning? It doesn't seem very benign.

https://github.com/scala-js/scala-js/issues/3351

julienrf commented 5 years ago

Thanks for reporting. We do use the Buffer API here:

https://github.com/scalacenter/scalajs-bundler/blob/master/sbt-scalajs-bundler/src/main/scala/scalajsbundler/util/JSBundler.scala#L77-L90

We should update this code to use the safe alternatives.