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.

Uncaught TypeError: self.getProgress is not a function in kosurvey.ts

See original GitHub issue

I’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:closed
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
andrewtelnovcommented, Aug 13, 2016

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

0reactions
andrewtelnovcommented, Aug 14, 2016

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

self.showLocalNotificationWrap is not a function - Stack Overflow
I don't have any function named showNotificationWrap. the error: sw.js:48 Uncaught TypeError: self.showLocalNotificationWrap is not a ...
Read more >
How to Handle JavaScript Uncaught TypeError: “x” is Not a ...
The Javascript TypeError: "x" is not a function occurs when calling a function on a value or object, which is not actually a...
Read more >
TypeError: "x" is not a function - JavaScript - MDN Web Docs
The JavaScript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value...
Read more >
JavaScript: Uncaught TypeError: n is not a function
This error occurs if you try to execute a function that is not initialized or is not initialized correctly. This means that the...
Read more >
How to fix "Uncaught TypeError: x is not a function" in JavaScript
JS Casts 01 - How to fix " Uncaught TypeError : x is not a function " in JavaScript.Visit https://javascriptcasts.com/episodes/01 for a summary ......
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