unlayer / react-email-editor

Drag-n-Drop Email Editor Component for React.js
https://unlayer.com/embed
MIT License
4.53k stars 730 forks source link

Cannot read properties of undefined (reading 'values') #356

Closed maksim36ua closed 1 year ago

maksim36ua commented 1 year ago

Hey @lucasbesen @adeelraza I've literally copy-pasted the code from the Readme and uncommented the onReady implementation:

const templateJson = {};
emailEditorRef.current.editor.loadDesign(templateJson);

I'm getting error messages in the console, and the editor dies.

editor.js:2 TypeError: Cannot read properties of undefined (reading 'values')
    at editor.js:2:899996
    at Ma (editor.js:2:4363368)
    at Cl (editor.js:2:4384237)
    at Al (editor.js:2:4383445)
    at wl (editor.js:2:4383050)
    at Ms (editor.js:2:4423958)
    at vu (editor.js:2:4409588)
    at hu (editor.js:2:4409516)
    at mu (editor.js:2:4409379)
    at ou (editor.js:2:4406190)
ll @ editor.js:2
editor.js:2 Uncaught TypeError: Cannot read properties of undefined (reading 'values')
    at editor.js:2:899996
    at Ma (editor.js:2:4363368)
    at Cl (editor.js:2:4384237)
    at Al (editor.js:2:4383445)
    at wl (editor.js:2:4383050)
    at Ms (editor.js:2:4423958)
    at vu (editor.js:2:4409588)
    at hu (editor.js:2:4409516)
    at mu (editor.js:2:4409379)
    at ou (editor.js:2:4406190)

I'm on React 18, tried out all the versions up to 1.5.0, used incognito mode, and played with the template by adding a body, but no luck. Any ideas?

maksim36ua commented 1 year ago

UPD: the same issue has been reported here