Issue #1288Opened July 16, 2018by panagulis720 reactions

Cannot read property 'body' of null - Angular

Question

Hi, I have a list of email template (page 'templates') and there is a button that open the edit (page 'templates/edit/:templateId'. All works fine, but when I go back into the templates' list I get this error in the console:

core.js:1624 ERROR TypeError: Cannot read property 'body' of null at Object.getBody (grapes.min.js:11) at Object.getWrapperEl (grapes.min.js:11) at R.i.getCanvasWrapper (grapes.min.js:11) at R.i.initialize (grapes.min.js:11) at R.i.e.View (grapes.min.js:2) at R.i [as constructor] (grapes.min.js:2) at new R.i (grapes.min.js:2) at Object.get (grapes.min.js:11)

Code SnippetTEXT
>     at R.i.updateActive (grapes.min.js:11)
>     at y (grapes.min.js:2)

I tried also to implements OnDestroy into my edit component, but it doesn't effect:
`  ngOnDestroy() {
    this.grapejsComponent.destroy();
  }`

P.S. this.grapejsComponent is the following object:
`
  initGrape() {
    this.grapejsComponent = grapesjs.init({
        ..........
     })
    }`

Answers (3)

artfJuly 20, 20180 reactions

Do you use the latest version? The error appears only in the templates list? So, does it work when you click back to the edit page?

no-response[bot]July 30, 20180 reactions

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

cmoutafidisSeptember 3, 20180 reactions

I sometimes get the same error whenever I hit ctrl+c. Grapesjs is integrated with angularjs.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.