Issue #440💬 AnsweredOpened October 20, 2017by ateshuseyin0 reactions

Not works with jquery

快速解答by artf

Do you get the same error with all of your blocks? Even with some official one?

Read full answer below ↓

Question

I use jquery in my project. After version 0.12.8 it does not work with jquery.

Prt of my webpack.config is;

resolve: {
    modules: [
      path.resolve(__dirname, 'node_modules/grapesjs/src'),
      path.resolve(__dirname, 'node_modules')
    ],
    alias: {
      'cash-dom': 'jquery'
    }
  },
  externals: {
    'jquery': 'jQuery'
  },

When I try to drop a block it throws;

ComponentsView.js:76 Uncaught TypeError: Cannot read property 'length' of undefined at child.addToCollection (ComponentsView.js:76) at child.addTo (ComponentsView.js:22) at triggerEvents (backbone.js:371) at triggerApi (backbone.js:356) at eventsApi (backbone.js:155) at child.Events.trigger (backbone.js:346) at child._onModelEvent (backbone.js:1187) at triggerEvents (backbone.js:372) at triggerApi (backbone.js:357) at eventsApi (backbone.js:155)

Answers (3)

artfOctober 23, 2017

Do you get the same error with all of your blocks? Even with some official one?

ateshuseyinOctober 24, 2017

Right. I get the same error with all blocks defined in mjml plugin.

artfOctober 24, 2017

Ok, I'd like to understand if it's something related to jquery. Are you able to reproduce it without the mjml plugin? (latest version)

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.