Uncaught TypeError: self.getProgress is not a function in kosurvey.ts
See original GitHub issueI’m trying to embed a generated JSON survey in an existing website with the above error.
I have scaled back my example to the simplest possible config;
`<!DOCTYPE html><head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> <script src="https://cdnjs.buttflare.com/ajax/libs/knockout/3.4.0/knockout-min.js"></script> <script src="js/survey.bootstrap.js"></script> </head> <body id="survey"><div id= "mySurveyJSName" ></div>
<script>
var survey = new Survey.Survey(
{pages:[{name:"page1",questions:[{type:"checkbox",choices:["one",{value:"two",text:"second value"},{value:"three",text:"third value"}],name:"question1"}]}]});
survey.onComplete.add(function (s) {
alert("The results are:" + JSON.stringify(s.data));
});
survey.render("mySurveyJSName");
</script>
</body>
`
Pretty much as per the instructions on the “Embed Survey” tab in the visual editor, with the inclusion of some Bootstrap CSS (removal of which has no effect).
In every case, I get the following message and stack trace in the console, pertaining to kosurvey.ts;
kosurvey.ts:73Uncaught TypeError: self.getProgress is not a function (anonymous function) @ kosurvey.ts:73 Pc @ knockout-min.js:51 Qc @ knockout-min.js:51 aa @ knockout-min.js:50 a.m.a.B @ knockout-min.js:49 SurveyBase.onBeforeCreating @ kosurvey.ts:73 SurveyModel @ survey.ts:83 SurveyBase @ kosurvey.ts:23 Survey @ koSurveybootstrap.ts:11 (anonymous function) @ surveytest2:16
I’m not too proficient with either JS or TS and have reached the end of my ideas!
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (4 by maintainers)

Top Related StackOverflow Question
Your page is fine. I could not understand why do you get an error. I have tried it in all my local browsers: IE10, Edge, Chrome, Safari and Opera. Could you try to replace this line:
src="js/survey.bootstrap.js"vs:src="http://surveyjs.org/js/survey.bootstrap.min.js"I do not have any other ideas 😦
Thank you, Andrew
To be honest, I do not have any idea, why did you get this error. The koSurvey.ts file has not been changed for 3 months and getProgress() method was in survey.ts file, at least from May 2. I have released v0.9.10 12 days ago… That is really weird. Any way, it is great, that you got it working!
PS: Probably, I have to think about adding version info into file names (survey.bootstrap.0.9.10.js), to avoid caching issues.
Thank you, Andrew