Issue #4940πŸ’¬ AnsweredOpened Feb 21, 2023by mani-rai0 reactions

Destroying and re-initializing produces "Cannot read properties of undefined (reading 'get')"

Quick answerby artf

Yeah, the editor instance is not expected to be destroyed immediately due to some deferred async functions (eg. for the StorageManager) but that can be fixed. For now you can overcome the issue by doing something like this:

Read full answer below ↓

Question

GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Google Chrome Version 110.0.5481.100 (Official Build) (64-bit) Reproducible demo link https://stackblitz.com/edit/js-3urscf?file=index.html,index.js Describe the bug How to reproduce the bug?Initialize the editorDestroy the editorInitialize the editor again What is the expected behavior? The code used is just a starter code from the official doc. It should be re-initialized without any problem. What is the current behavior? Multiple errors are show in console.TypeError: Cannot read properties of u...

Answers (2)

artfβ€’ Feb 23, 2023

Yeah, the editor instance is not expected to be destroyed immediately due to some deferred async functions (eg. for the StorageManager) but that can be fixed. For now you can overcome the issue by doing something like this:

setTimeout(() => {
  editor.destroy();
  ...
GJSBlockβ€’ May 17, 2026

Thanks for reporting this, @mani-rai. Great question about Destroying and re-initializing produces "Cannot read properties of undefined (reading 'get')". The recommended approach with ProseMirror is to use the event-driven API. Start here: Check the GrapesJS documentation for your specific module L...

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...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins β†’
Premium option

Premium plugins ship with support, regular updates, and production-ready features β€” save days of integration work.

Browse premium plugins β†’

Related tutorials

In-depth guides on the same topic.

All tutorials β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.