question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

1.3.6 'isBuffer is not a function' when minified

See original GitHub issue

I’m encountering an issue which only occurs on a uglified/minified production build, and only with version 1.3.6. Version 1.3.5 works great.

I’ve traced it down to a clone function in quill.core.js in the 1.3.6 build which dies on line 3948.

} else if (useBuffer && Buffer.isBuffer(parent)) {

in the minified code it looks like:

else { if (m && t.isBuffer(r))

with the error Uncaught TypeError: t.isBuffer is not a function

Now, I’m not entirely sure what the deal is! This is on a large project, with a bunch of dependencies, and this latest update of 1.3.6 is the only thing that has an issue. If I roll back to 1.3.5, everything works. It doesn’t look like this area of code was touched at all according to the change log either.

There are no compile errors at all! The only reason I found this was a few customer emails saying that things died when they open up the rich text editor.

Any suggestions?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
fedorenkocommented, Sep 7, 2018

I had the same problem with my production bundle, and none of the previous recommendations has helped to solve it.

So I ended up with using the default UglifyJS plugin and setting the “reduce_vars” flag in the options to false:

uglify: {
    compress: {
        reduce_vars: false,
    },
},

Package versions I used:

webpack@3.3.0
uglifyjs-webpack-plugin@0.4.6
quill@1.3.6

It’s worked for me, hope it will help.

3reactions
timothyallancommented, Mar 19, 2018

All the info is in the second sentence of the readme: “webpack =< v3.0.0 currently contains v0.4.6 of this plugin under webpack.optimize.UglifyJsPlugin as an alias. For usage of the latest version (v1.0.0), please follow the instructions below”

edit: the “conditionals” flag in UglifyJS seems to be the root cause of the issue if people don’t want to update. But then that removes that conditional optimization feature for every one of your dependancies, just to work around Quill > 1.3.5

Read more comments on GitHub >

github_iconTop Results From Across the Web

Buffer.isBuffer() is not a function in zlib - Stack Overflow
isBuffer () is not a function when I am trying to use the zlib.gzip() method. I noticed the same error for the gunzip,...
Read more >
uglify-js - npm
Useful when minifying CommonJS modules and Userscripts that may be anonymous function wrapped (IIFE) by the .user.js engine `caller`. ` ...
Read more >
Compare Versions | nuxt | npm - Open Source Insights
mime 1.3.6 ... GHSA-w7rc-rwvf-8q5rThe `size` option isn't honored after following a ... @babel/helper-member-expression-to-functions 7.18.9.
Read more >
OpenGL 4.6 (Core Profile) - May 5, 2022 - Khronos Registry
1.2.4 Fixed-function Hardware and the Compatibility Profile . ... value that is not the name of a buffer object, IsBuffer returns FALSE.
Read more >
Web Libraries in Jars - WebJars
Jolokia Client Javascript, org.webjars, jolokia.js, 1.6.2 1.6.1 1.6.0 1.5.0 1.4.0 1.3.7 1.3.6 1.3.5 1.3.4 1.3.3 1.3.2 1.2.2.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found