Issue #2700Opened April 3, 2020by noogen0 reactions

[Bug] Hover editor result in TypeError: this[0].getAttribute is not a function

Question

  1. Are you using the latest release (older versions are NOT supported)? Yes, using latest v0.16.3 version.

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

artfApril 15, 20200 reactions

@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)

no-response[bot]April 25, 20200 reactions

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.

HassanElZarkawyJune 29, 20200 reactions

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.

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.