Question T8522
Visible to All Users
Duplicate

We have closed this ticket because another page addresses its subject:

Matrix with single input cell issue

Js error after build prod with angular

created 3 years ago (modified 3 years ago)

Hello,
After 'ng build --configuration=production' this piece code:

JavaScript
QuestionMatrixDropdownModelBase.prototype.hasErrorInRows = function (fireCallback, rec) { var _this = this; if (!this.generatedVisibleRows) { var rows = this.visibleRows; } var res = false; if (!rec) rec = {}; rec.isSingleDetailPanel = this.detailPanelMode === "underRowSingle"; for (var i = 0; i < this.generatedVisibleRows.length; i++) { res = this.generatedVisibleRows[i].hasErrors(fireCallback, rec, function () { _this.raiseOnCompletedAsyncValidators(); }) || res; } return res; }

Before build:
before_build.PNG

with be compiled to this:

JavaScript
t.prototype.hasErrorInRows = function (e, t) { var n = this, i = !1; t || (t = {}), t.isSingleDetailPanel = "underRowSingle" === this.detailPanelMode; for (var o = 0; o < this.generatedVisibleRows.length; o++)i = this.generatedVisibleRows[o].hasErrors(e, t, function () { n.raiseOnCompletedAsyncValidators() }) || i; return i }

After build:
after_build.PNG

as you can see this part

JavaScript
if (!this.generatedVisibleRows) { var rows = this.visibleRows; }

was removed and it causes a js error and the survey is not displayed :
error.PNG

I have to mention that the problem reproduced when we use the matrix components.

I appreciate your help.

Answers approved by surveyjs Support

created 3 years ago

Hello Houssem,
Here is the duplicated issue. I have answered there.
If you could help us to reproduce the issue, it would be great.

Thank you,
Andrew
SurveyJS Team