regression-multivariate-linear icon indicating copy to clipboard operation
regression-multivariate-linear copied to clipboard

Angular 7 - TypeError: this.mulS is not a function

Open gartlady opened this issue 6 years ago • 1 comments

Production builds (ng build --prod) on Angular 7 cause the following run-time error:

ERROR TypeError: this.mulS is not a function
    at gt.neg (23.369596488ada8da4c33c.js:1)
    at new yt (23.369596488ada8da4c33c.js:1)
    at t.updatePredictions (23.369596488ada8da4c33c.js:1)
    at t.selectCoefficient (23.369596488ada8da4c33c.js:1)
    at Object.handleEvent (23.369596488ada8da4c33c.js:1)
    at Object.handleEvent (main.ee0e12944194d6c0edd4.js:1)
    at Object.handleEvent (main.ee0e12944194d6c0edd4.js:1)
    at Dr (main.ee0e12944194d6c0edd4.js:1)
    at main.ee0e12944194d6c0edd4.js:1
    at t.o [as _next] (main.ee0e12944194d6c0edd4.js:1)

This points to the following function:

    neg() {
        return this.mulS(-1)
    }

Building with optimization set to false in the angular.json fixes the issue for now, however, this isn't a long term solution.

I've also applied the suggested fix from the following issue to allow the package to compile in Angular: https://github.com/mljs/regression-multivariate-linear/issues/15

Any ideas?

Thanks, Dylan

gartlady avatar Jan 07 '20 14:01 gartlady

Isn't it a bug in ng build if it removes a method that is actually used by the code?

targos avatar Jan 07 '20 14:01 targos