Not works with jquery
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)
Do you get the same error with all of your blocks? Even with some official one?
Right. I get the same error with all blocks defined in mjml plugin.
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.
Issue #959
[BUG] Intermittent test failure on `dev` branch due to race condition
I recommend adding --bail after the mocha command in package.json's test to make this easier to see, e.g.: On the latest dev branch, this i...
Issue #800
[Bug]: Using postcss-cssnext in webpack results in an error when importing dist/css/grapes.min.css
Hi We're using postcss-cssnext plugin in our webpack project. Importing the grapes.min.css results in the following error:
Issue #369
Usage from source failed
I tried to use grapesjs from source by using require('grapesjs/src') to debug both my source and grapesjs. But could not success because of...
Issue #1911
[Question] Is Knockout.js compatible with Grapesjs?
I'm trying to implement an attr binding on one of my components using Knockout.js. It works perfectly fine otherwise but the same implement...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins β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.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.