Survey-library: Error in render: "TypeError: _this.createLocalizableString is not a function"

Created on 28 Oct 2019  路  3Comments  路  Source: surveyjs/survey-library

Are you requesting a feature, reporting a bug or asking a question?

~Reporting a bug~ Asking a question

What is the current behavior?

~Crashing when including the Vue library into a fresh Vue project~

What is the expected behavior?

~To not generate runtime errors~

How would you reproduce the current behavior (if this is a bug)?

package.json

{
  "name": "TypeError",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint"
  },
  "dependencies": {
    "bootstrap": "^4.3.1",
    "bootstrap-vue": "^2.0.4",
    "core-js": "^3.3.2",
    "survey-vue": "^1.1.17",
    "vue": "^2.6.10",
    "vue-i18n": "^8.15.0",
    "vue-router": "^3.1.3",
    "vuex": "^3.1.1"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "^4.0.0",
    "@vue/cli-plugin-eslint": "^4.0.0",
    "@vue/cli-service": "^4.0.0",
    "babel-eslint": "^10.0.3",
    "eslint": "^5.16.0",
    "eslint-plugin-vue": "^5.0.0",
    "sass": "^1.19.0",
    "sass-loader": "^8.0.0",
    "vue-template-compiler": "^2.6.10"
  }
}

Provide the test code and the tested page URL (if applicable)

Tested page URL: N/A

AComponent.vue

<template>
    <div class="wrapper">
        <survey v-if="surveyConfig" :survey="surveyConfig"></survey>
    </div>
</template>

<script>
import * as SurveyJS from 'survey-vue'

export default {
    name: 'a-component',

    props: {
        config: {
            type: Object,
            default: undefined
        }
    },

    computed: {
        surveyConfig() {
            return this.config ? SurveyJS.Model(this.config) : undefined
        }
    },

    components: {
        survey: SurveyJS.Survey
    }
}
</script>

Specify your

  • browser: N/A
  • browser version: N/A
  • surveyjs platform (angular or react or jquery or knockout or vue): Vue
  • surveyjs version: See package.json
question

All 3 comments

Tried reducing my relatively large survey config to the below, no success

{
    "title": "foo",
    "pages": [{
        "name": "page",
        "elements": [{
            "type": "rating",
            "name": "name",
            "title": "title",
            "isRequired": true,
            "minRateDescription": "minimum",
            "maxRateDescription": "maximum"
        }]
    }]
}

I'll take a look

@tsv2013 I've found my problem. I wasn't using new

    computed: {
        surveyConfig() {
            return this.config ? **new** SurveyJS.Model(this.config) : undefined
        }
    },

Sorry to bother you 馃槄

Was this page helpful?
0 / 5 - 0 ratings

Related issues

enricribas picture enricribas  路  3Comments

GuiAfonso picture GuiAfonso  路  4Comments

aslanbeily picture aslanbeily  路  4Comments

dmitrykurmanov picture dmitrykurmanov  路  3Comments

halexiev-hedgeserv picture halexiev-hedgeserv  路  4Comments