[Bug] Hover editor result in TypeError: this[0].getAttribute is not a function
Question
-
Are you using the latest release (older versions are NOT supported)? Yes, using latest v0.16.3 version.
-
What happen?
Upgraded from WORKING v0.15.3 to v0.16.3. Also, went back and verify that this is WORKING in v0.15.10
Demo to reproduce the problem https://niiknow.github.io/grapesjs-components-farmer/ in latest Firefox and Chrome.
Error output to Chrome console:
Uncaught TypeError: this[0].getAttribute is not a function
at Cash../node_modules/cash-dom/dist/cash.esm.js.fn.attr (grapes.js:3475)
at getData (grapes.js:3677)
at Cash../node_modules/cash-dom/dist/cash.esm.js.fn.data (grapes.js:3730)
at child.onHover (grapes.js:27349)
at executeBound (grapes.js:18742)
at HTMLBodyElement.<anonymous> (grapes.js:18755)
at HTMLBodyElement.<anonymous> (grapes.js:18102)
Debug show that, on hover of the body DOM, it try to try to get model data of body.parent which is the document object.
Answers (3)
@noogen can you please create a reproducible demo on something like jsfiddle? (without your preset/plugin, so I know the issue comes from the core)
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'm also having this issue. With me it happens whenever i try to canvas option in init.
const editor = grapesjs.init({
// Indicate where to init the editor. You can also pass an HTMLElement
container: '#gjs',
// Get the content for the canvas directly from the element
// As an alternative we could use: `components: '<h1>Hello World Component!</h1>'`,
fromElement: true,
width: 'auto',
// Disable the storage manager for the moment
storageManager: false,
plugins: ['gjs-preset-webpage'],
pluginsOpts: {
'gjs-preset-webpage': {
// options
}
},
canvas: {
styles: [
`@asset('css/front/style.min.css')`,
`@asset('css/front/bootstrap.min.css')`,
],
scripts: [
`@asset('js/front/jquery.min.js')`,
`@asset('js/front/bootstrap.bundle.min.js')`,
`@asset('js/front/plugins.min.js')`,
`@asset('js/front/main.min.js')`,
],
}
});
When i remove the canvas config part in the options everything seems to work fine.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1758
Unable to load in CSS string with characters such as '#' with setStyle()
You're submitting a BUGAre you using the latest release (older versions are NOT supported)?If you're not sure, type grapesjs.version in con...
Issue #1693
[BUG|/QUESTION] Strange characters (Â) within CSS/HTML preview; Elements are not deleted completely
BUGAre you using the latest release (older versions are NOT supported)?0.14.50Are you facing the bug with your local copy of GrapesJS or wi...
Issue #5144
BUG: Incorrect type definition for PanelManager.addPanel
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? All Reproducible demo link None Describe t...
Issue #5141
BUG: component resets attribute values on updating traits ( first time only )
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome Version 113.0.5672.63 Reproducible...
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.