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)
> 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)
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?
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.
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.
Issue #1906
Components & Js - Load Template
Hey, I have a component which has a JS attached to it. Everything is created using the JS. When I drag and drop my block for the first time...
Issue #1123
[QUESTION] Onload event inside template
Hi! I have a problem with some templates. This template has some scripts running after the page is loaded. When this templates is loaded by...
Issue #1888
[Question] Add custom html inside canvas
Hi there, I'm using grapes to export a custom json with all the information i need, instead of HTML and CSS. For doing that I'm parsing the...
Issue #2663
[BUG] WASD keypress returns an errror at Canvas
Hi there, I get an error on a keypress at canvas without RTE enabled. Uncaught TypeError: Cannot read property 'hasFocus' of null node_modu...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.