Issue T6682
Visible to All Users

TypeError: Cannot read property 'getType' of undefined

created 4 years ago

Hi,

I get this error when I add a new page, then drag and drop any item from the toolbox.
I drag an item, it gets on the survey then everything freeze and the error appears.
I used the classic React save approach, just the names are slightly changed.

Code
import React, { Component } from "react";import * as SurveyCreator from "survey-creator";import "survey-knockout/survey.css";import "survey-creator/survey-creator.css";import "./index.css";SurveyCreator.StylesManager.applyTheme("modern");class SurveyCreatorBuilder extends Component { constructor(props) { super(props); } componentDidMount() { const creatorOptions = {}; const creator = new SurveyCreator.SurveyCreator("creatorElement", creatorOptions); creator.showToolbox = "right"; creator.showPropertyGrid = "right"; creator.rightContainerActiveItem("toolbox"); creator.isAutoSave = true; creator.showState = true; const localStorageName = "SaveLoadSurveyCreatorExample"; creator.saveSurveyFunc = function(saveNo, callback) { window.localStorage.setItem(localStorageName, creator.text); callback(saveNo, true); }; const defaultJSON = {}; creator.text = window.localStorage.getItem(localStorageName) || JSON.stringify(defaultJSON); } render() { return ( <div id="creatorElement" /> ); }}export default SurveyCreatorBuilder;

Clipboard-File-1.png

Comments (2)

    I want to mention that this can also be reproduced in the CodeSandBox https://codesandbox.io/s/okn0i link you provided. Kepp adding pages and drag and drop items.

    Also , I updated to the latest version 1.8.39, the error still persists.

      Hello,
      I was able to reproduce the issue. We will take a look.

      Thank you,
      Andrew
      SurveyJS Team

      Answers approved by surveyjs Support

      created 4 years ago

      Hello,

      I've fixed the issue via the https://github.com/surveyjs/survey-creator/commit/bf7b8cac522926ab4bc57810de2886ab0d8fde62 commit. Fix will be available in the nearest minor update, most likely next tuesday.

      Thanks, Serge
      SurveyJS Team