GrapesJS Issues

3,464 parsed GitHub issues β€” 370 solved Β· 90 open. Search, filter and explore battle-tested answers.

743 issues found

πŸ” bug
#3352Mar 19, 2021by harsh2014 answers
1 reactions

Default Content is getting Inserted while using setComponents if Tag Body is empty

Version: Latest You can get the version by typing grapesjs.version into the console Are you able to reproduce the bug from the demo?[X] Yes[ ] No What is the expected behavior? Component with empty body should not be populated with default content. What is the current behavior? When we create an empty node and pass it...

artf

You have defined the default content in the component definition, so, an empty one will use that as default. Just move that content from component definition to the paragraph block.

harsh201

@artf Any help here?

harsh201

Thanks @artf! Completely forgot about adding at block level.

#3350Mar 18, 2021by devtechk3 answers
4 reactions

Uncaught TypeError: can't access property "el", n is undefined

Hello, I'm using grapesjs 0.16.44 and only in firefox I'm faceing this issue. Using grapesjs block basic preset. Anyone can help me? Thank you a lot!

artf

try to place your code inside

devtechk

Problem "solved" removing : looking for a better solution to make active the block panel af first I've also noticed other conflict like with my custom modals and modal from export plugin (clicking export plugin was fire my custom modal on...

GJSBlock

Thanks for reporting this, @devtechk. The issue with Uncaught TypeError: can't access property "el", n is undefined appears to be a race condition or state management timing problem. This typically happens when component lifecycle events a...

#3343Mar 17, 2021by neilkyoung4 answers
0 reactions

Illegal Invocation error when using keepEmptyTextNodes

Version: 0.16.44 Are you able to reproduce the bug from the demo?[x] Yes[ ] No Set editor.Parser.getConfig().keepEmptyTextNodes = true; in the console and then attempt to drag a form into a 2 column plugin. What is the expected behavior? Describe the bug detailed From my observation a keepEmptyTextNodes will throw an...

artf

Well, yeah makes sense, probably we should take the first "valid" element (the one which actually supports matches). But I'm also curious to know your case for the use of keepEmptyTextNodes. A few days ago I was actually thinking about rem...

neilkyoung

@artf A system we use for web page authoring implements this. Although we have now managed to convince them to disable this thanks to your comment above :-D

artf

Great, I'll close this then. Let me know in case there is something wrong/different with that change on your side

#3342Mar 17, 2021by RutujaBadbe2 answers
0 reactions

JQuery not working for script in component

Hi! I have tried adding jquery in canvas as well as in index.html I am adding it in canvas like this- canvas = editor.Canvas; const script1 = document.createElement('script'); script1.src = 'https://code.jquery.com/jquery-3.6.0.min.js'; canvas.getDocument().head.appendChild(script1); and in html page I have added it a...

artf

Here you can see how to load dependencies properly https://grapesjs.com/docs/modules/Components-js.html#template-related

GJSBlock

Thanks for reporting this, @RutujaBadbe. The error ReferenceError: $ is not defined occurs when Canvas attempts to access properties before the component lifecycle is fully initialized. This is a common race condition in GrapesJS. Immediat...

#3334Mar 11, 2021by KernelDeimos2 answers
0 reactions

Attempts to load scripts to canvas maybe breaks javascript??

Version: 0.16.44 Are you able to reproduce the bug from the demo? [ ] Yes [x] No What is the expected behavior? Legit anything else Describe the bug detailed I was attempting to load scripts into the canvas. My first attempt was scripts: [] and then I ran into the synchronization issue mentioned in this PR's thread: h...

KernelDeimos

I haven't used inline <script> tags in a while and forgot about this caveat of the HTML parser. Closing this.

GJSBlock

Thanks for reporting this, @KernelDeimos. The issue with Attempts to load scripts to canvas maybe breaks javascript?? appears to be a race condition or state management timing problem. This typically happens when component lifecycle events...

#3333Mar 11, 2021by xinnai4 answers
1 reactions

Npm start not working

Hi, I want to develop the source code but I cannot get started. I got errors when start the project. Can anybody help me? Thank you very much!!!

xinnai

@Andrew-Chen-Wang I think that must be something with my develop environment so I use another computer to install and move it to my computer , still don't know why but now it works fine. Hope no errors happen again, and thank you so much!!!

Andrew-Chen-Wang

For source code development, check out: https://github.com/artf/grapesjs#development

xinnai

@Andrew-Chen-Wang Yeah, I did that, but always get this error, what can I do?

#3325Mar 9, 2021by mmotov4 answers
0 reactions

JSON.stringify(this.editor.getComponents()) Error

Version: 0.16.44 Hi there! I have remote storage for pages, and recently I faced an issue when saving page, JSON.stringify(editor.getComponents()) started to throw error Uncaught TypeError: e[M].getId is not a function. I investigated the already saved JSON representation of the page and found out that it fails on thi...

yucomds

Same error here ... do you have a solution? [EDIT] Downgrading seems to be the only solution for now

josfh2005

Same problem here, if I preprocess the components and remove that attribute (__symbol) before load the Editor the template works fine. Is the a way @artf to disable the symbols for now?

artf

Yeah unfortunately the previous version of grapesjs had a bug that created symbols involuntary. In the current version, the bug is fixed and symbols are disabled, but unfortunately, this still happens if you try to load a component with a...

#3319Mar 5, 2021by anatoli-dp3 answers
0 reactions

Layers text does not center after creating a new line

Version: current? You can get the version by typing grapesjs.version into the console Are you able to reproduce the bug from the demo? [ ] Yes [ x] No // to be fair never tried in the demo What is the expected behavior? when editing the layers text and adding a new line then backspacing i would expect the edited text...

artf

Ok, I'll push a fix for the editing of layers name, probably it doesn't make sense having new lines enabled there (I'll make stop the editing on Enter/Esc). For the second issue, If you're using something yours to resize the canvas, probab...

anatoli-dp

yeah I didn't realize editor.refresh() was a thing until after. otherwise thanks. awesome project

GJSBlock

Thanks for reporting this, @anatoli-dp. Great question about layers text does not center after creating a new line. The recommended approach with Canvas is to use the event-driven API. Start here: Check the GrapesJS documentation for your...

#3316Mar 5, 2021by am1rb4 answers
1 reactions

The editor does not remove the dead script blocks

Version: 0.16.34 Are you able to reproduce the bug from the demo? [ ] Yes [x ] No As I understand the code import dialog skips all the HTML scripts, so I can not reproduce the issue on the demo What is the expected behavior? The editor must remove dead script blocks before appending a new script block at the end of th...

Ju99ernaut

I'm unable to reproduce this, maybe you can provide more information on the custom component itself, anyway I suspect this is a storage related issue. Are you storing then loading pages from the generated html?

Andrew-Chen-Wang

Typically inline scripts go in the body at the bottom. Try putting it there maybe?

am1rb

I do not append anything by myself. The editor appends the scripts related to my components in a new script tag at the end of the generated HTML. Please take a look at this file: https://github.com/artf/grapesjs/blob/dev/src/editor/model/E...

#3310Mar 5, 2021by Andrew-Chen-Wang3 answers
3 reactions

Tablet and mobile view not resizing

Version: The one in the demo Are you able to reproduce the bug from the demo? [X] Yes [ ] No What is the expected behavior? Mobile and tablet view should resize the canvas when window resizes. Describe the bug detailed The desktop view properly resizes the canvas when resizing the window What is the current behavior?...

Ju99ernaut

The mobile and tablet devices are pixel pased, so they just resize the canvas to a certain number of pixels regardless of window size. I believe desktop just sets canvas to 100%.

artf

As mentioned by @Ju99ernaut this is how devices work. Honestly, I don't even see the reason behind such a case, why the user should resize the window? You might also start to see/update styles not related to the proper device and that woul...

GJSBlock

Thanks for reporting this, @Andrew-Chen-Wang. The issue with Tablet and mobile view not resizing appears to be a race condition or state management timing problem. This typically happens when component lifecycle events and DOM modification...

Browse all topics