Search code examples
typescriptsurveyjs

SurveyCore.Model is not a constructor


import * as Survey from 'survey-core'
var surveyModel = new Survey.model(myJson)

Survey is coming to be as undefined causing an error TypeError: Survey.Model is not a constructor

I have imported survey-core library and included it in the project but i am facing this issue.

NOTE: If I work with survey-jquery then it works fine. What should I do?


Solution

  • You need to use the Survey.Model (Model from the capital letter) instead of Survey.model