简体   繁体   English

带有Pace-Progress库的Angular2,错误:未定义缓冲区

[英]Angular2 with Pace-Progress library, Error: Buffer is not defined

The Pace library (Pace-Progress is the name of it on NPM because Pace was already taken) is throwing this error when imported. Pace库(Pace-Progress是NPM上的名称,因为已经使用了Pace)在导入时抛出此错误。 I am using Angular2 and Webpack. 我正在使用Angular2和Webpack。 The line of code throwing the error is 引发错误的代码行是

exports.isBuffer = Buffer.isBuffer;

I have a buffer library available from NPM was well, but why would Pace be expecting me to load another library in advance for it to work? 我可以从NPM获得一个缓冲库,但是为什么Pace会期望我提前加载另一个库才能工作? What could I be doing wrong? 我可能做错了什么?

Buffer is a part of Node API and usually shouldn't be found in client side code. Buffer是Node API的一部分,通常不应在客户端代码中找到。

Most simple way to use it in bundle is to use Webpack polyfills . 捆绑使用它的最简单方法是使用Webpack polyfills

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM