Skip to content

error when trying to load an empty template #123

@danbars

Description

@danbars

When calling emailEditor.value.editor.loadDesign({}) there's an error thrown from editor.js, and the editor isn't opened.
This used to work, and I'm not sure when exactly is was broken.
Also upgraded from 2.1.4 to 2.1.5 (which has breaking changes that shouldn't exist in a patch version, but that's another story) - and the error still exists.

The solution was to check if the template that I have is "empty" and not call loadDesign.
This is the exception that I get:

editor.js:2 Uncaught (in promise) TypeError: Cannot convert undefined or null to object
    at Object.values (<anonymous>)
    at editor.js:2:3885288
    at produce (editor.js:2:8579012)
    at 16 (editor.js:2:3885265)
    at W (editor.js:2:3890250)
    at W (editor.js:2:3890242)
    at W (editor.js:2:3890242)
    at W (editor.js:2:3890242)
    at W (editor.js:2:3890242)
    at W (editor.js:2:3890242)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions