[Pkg-javascript-devel] Bug#960901: Buffer is a built-in node function

Pirate Praveen praveen at onenetbeyond.org
Tue Dec 29 11:27:34 GMT 2020



On Tue, Dec 29, 2020 at 20:02, Ben Finney <bignose at debian.org> wrote:
> Control: found -1 webpack/4.43.0-6
> 
> On 16-Jun-2020, Ben Finney wrote:
>>  On 18-May-2020, Pirate Praveen wrote:
>>  > 
>> https://salsa.debian.org/js-team/node-clone/-/blob/master/clone.js#L109
>>  > I think we may need to embed older version of buffer module in
>>  > node-libs-browser
>> 
>>  Okay. I assume that is information for the ‘node-libs-browser’
>>  maintainer, I think as a user I can't affect that.
> 
> Pirate, can you open a new bug report if necessary? I don't understand
> the above information enough to know even whether an additional bug
> report is required, or what it would report.
> 

As user of webpack, you need to configure it properly. You need to 
specify how webpack should handle node builtins like buffer.

>>  > For this particular case you can try embedding buffer module
>>  > version 4.x as browsers need an equivalent module to features
>>  > present only in node.
>> 
>>  This looks like advice for me to work around the problem. What do I
>>  need to do? How do I (as a user of Webpack) “embed buffer module
>>  version 4.x”?
> 
> What does that suggestion mean, and who should take action to make it
> happen?

That was not an exact assessment. It was a possibility I could think.

In case of rollup, there is a plugin rollup-plugin-node-polyfills that 
resolves these builtins for rollup. I don't know what is the equivalent 
of webpack here.

If you don't have a specific requirement to using webpack, I suggest 
you try rollup and rollup-plugin-node-polyfills instead of webpack.

I don't think this is an issue specific to the debian package, but 
something that decided by webpack upstream. So you need to check the 
upstream documentation for webpack and figure out how to tell webpack 
to resolve these builtins.



More information about the Pkg-javascript-devel mailing list