GrapesJS / mjml

Newsletter Builder with MJML components in GrapesJS
http://grapesjs.com/demo-mjml.html
BSD 3-Clause "New" or "Revised" License
637 stars 227 forks source link

Backbone.UndoManager is not a constructor #16

Closed ghost closed 6 years ago

ghost commented 7 years ago

while loading my grapes-mjml component second time it gives backbone.undomanager error

Backbone.UndoManager is not a constructor
    at N.d.initUndoManager (grapes.min.js:17)
    at Object.onLoad (grapes.min.js:15)
    at grapes.min.js:17
    at Array.forEach (<anonymous>)
    at N.d.initialize (grapes.min.js:17)
    at N.d.b.Model (grapes.min.js:2)
    at new N.d (grapes.min.js:3)
    at new b (grapes.min.js:17)
    at Object.init (grapes.min.js:17)
    at VueComponent.mounted (Hello.vue?de18:14)

So, How to destroy grapesjs.init({ }) ??

this is my script code,

<script>
let editor = null;
export default {
  name: 'templateEditor',
  mounted () {
    editor = grapesjs.init({
      height: '100%',
      noticeOnUnload: 0,
      storageManager:{autoload: 0},
      container : '#gjs',
      fromElement: true,
      plugins: ['gjs-mjml'],
      pluginsOpts: {
        'gjs-mjml': {}
      }
    });
    window.editor = editor;
  }
}
</script>
artf commented 7 years ago

Which version of grapesjs do you use?

ghost commented 7 years ago

you mean grapejs or grapjs-mjml ?

ghost commented 7 years ago

i am using grapejs-mjml "0.0.8"

artf commented 7 years ago

grapesjs

ghost commented 7 years ago

grapesjs ^0.12.6

artf commented 7 years ago

Sorry but I can't reproduce, try to recreate it with something like jsfiddle/codesandbox

kavi-i commented 6 years ago

this issue is resolved in newer version. So it should be close

artf commented 6 years ago

@Kav-i thanks for letting me know 👍