Git Product home page Git Product logo

Comments (5)

netil avatar netil commented on June 16, 2024 1

I have same issue, and figured out that webpack-common-shake is doing some transformation on reserved words.
The part of SockJS contains following code:

, number: function(max) {
    return Math.floor(Math.random() * max);
  }

, numberString: function(max) {
    var t = ('' + (max - 1)).length;
    var p = new Array(t + 1).join('0');
    return (p + this.number(max)).slice(-t);
  }

After the common-shake plugin above code is transformed as:

, "number": ((function(max) {
    return Math.floor(Math.random() * max);
  }),null)

which this.number ended up being null, instead of function.

from webpack-common-shake.

typeofweb avatar typeofweb commented on June 16, 2024

👍 That's exactly the same problem I have. It seems that the comma operator shouldn't be here.

from webpack-common-shake.

indutny avatar indutny commented on June 16, 2024

Hello!

I'll take a look at it later this week. It has nothing to do with reserved words, however, as number is not one of them.

The way it adds comma and null is a normal mode of operation. This function is unused in this library, so it isolates it for later removal by UglifyJS.

Will see what's the underlying problem a bit later.

Thanks for reporting!

from webpack-common-shake.

usirin avatar usirin commented on June 16, 2024

Hello @indutny thanks for all the work you have done so far! It definitely helped me a lot!

But starting from today, i started to encounter this issue as well. Do you have any updates regarding this problem?

from webpack-common-shake.

CertainLach avatar CertainLach commented on June 16, 2024

Having same issue when trying to use createVerify reexported from browserify-sign by browserify-crypto
image

from webpack-common-shake.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.