Issue #5274Opened August 3, 2023by wunksert1 reactions

BUG: Parser bug inside Remix

Question

GrapesJS version

  • I confirm to use the latest version of GrapesJS

What browser are you using?

Chrome v114

Reproducible demo link

https://github.com/wunksert/remix-grapes-error/tree/main

Describe the bug

How to reproduce the bug?

  1. Clone repo above

  2. npm i

  3. npm run dev you'll see that the grapes iframe and boilerplate is rendered into the canvas.

  4. Try to export and you'll see that all the grapes boilerplate is also rendering into the canvas

  5. Open dev tools and you'll see the error:

Component.ts:910 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'querySelector')
    at o2.getBody (Component.ts:910:16)
    at o4._upFrame (sample.js:20:20)
    at min.js:12:54
    at Array.forEach (<anonymous>)
    at o4.toggleVis (min.js:12:21)
    at o4.run (max.js:13:7)
    at e3.callRun (ShowOffset.ts:16:26)
    at o2.runCommand (index.ts:805:3)
    at n2.updateActive (PropertyFactory.ts:421:47)
    at g (backbone.js:482:10)

Additional context

What is the expected behavior? The editor should render it's boilerplate properly, the same way as it

What is the current behavior? The parser doesn't seem to work. The editor renders the iframe that's meant to encapsulate the editor DOM. It also exports all the grapesJS boilerplate.

If is necessary to execute some code in order to reproduce the bug, paste it here below:

Code of Conduct

  • I agree to follow this project's Code of Conduct

Answers (3)

artfAugust 6, 20231 reactions

@wunksert it seems like the editor initializes on itself multiple times, are you properly clearing the editor instance with destroy (eg. in your useEffect)?

wunksertAugust 3, 20230 reactions

It might turn out that a fix for this is more simply solved by me editing structure or naming conventions in my project. Happy to do that if it's faster than changing something in GrapesJS core.

artfAugust 3, 20230 reactions

yeah definitely not related to the core

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.