marcusig / gutenberg-section-block

A section block for Gutenberg
Other
102 stars 28 forks source link

Error when trying to add a background image - TypeError: this.activateMode is not a function #13

Closed adrienlamotte closed 5 years ago

adrienlamotte commented 5 years ago

Hello,

When I click on "Background image", an error is dispatched :

react-dom.min.js?ver=16.6.3:104 TypeError: this.activateMode is not a function
    at load-scripts.php?c=1&load[]=thickbox,hoverIntent,common,admin-bar,heartbeat,postbox,wp-backbone,media-models,wp-plupload,wp-mediaelement,wp-api-request,medi&load[]=a-views,wp-dom-ready,wp-plugins&ver=5.0.2:350
    at arrayEach (lodash.js?3387:516)
    at Function.forEach (lodash.js?3387:9344)
    at n._createModes (load-scripts.php?c=1&load[]=thickbox,hoverIntent,common,admin-bar,heartbeat,postbox,wp-backbone,media-models,wp-plupload,wp-mediaelement,wp-api-request,medi&load[]=a-views,wp-dom-ready,wp-plugins&ver=5.0.2:350)
    at n.initialize (load-scripts.php?c=1&load[]=thickbox,hoverIntent,common,admin-bar,heartbeat,postbox,wp-backbone,media-models,wp-plupload,wp-mediaelement,wp-api-request,medi&load[]=a-views,wp-dom-ready,wp-plugins&ver=5.0.2:350)
    at n.initialize (load-scripts.php?c=1&load[]=thickbox,hoverIntent,common,admin-bar,heartbeat,postbox,wp-backbone,media-models,wp-plupload,wp-mediaelement,wp-api-request,medi&load[]=a-views,wp-dom-ready,wp-plugins&ver=5.0.2:350)
    at n.initialize (load-scripts.php?c=1&load[]=thickbox,hoverIntent,common,admin-bar,heartbeat,postbox,wp-backbone,media-models,wp-plupload,wp-mediaelement,wp-api-request,medi&load[]=a-views,wp-dom-ready,wp-plugins&ver=5.0.2:350)
    at n.e.View (backbone.min.js?ver=1.2.3:1)
    at n.constructor (load-scripts.php?c=1&load[]=thickbox,hoverIntent,common,admin-bar,heartbeat,postbox,wp-backbone,media-models,wp-plupload,wp-mediaelement,wp-api-request,medi&load[]=a-views,wp-dom-ready,wp-plugins&ver=5.0.2:345)
    at n.constructor (load-scripts.php?c=1&load[]=thickbox,hoverIntent,common,admin-bar,heartbeat,postbox,wp-backbone,media-models,wp-plupload,wp-mediaelement,wp-api-request,medi&load[]=a-views,wp-dom-ready,wp-plugins&ver=5.0.2:350)

Thank you :)

Wordpress 5.0.2 Gutenberg Section Block 1.1.2

adrienlamotte commented 5 years ago

The error seems to come from CGB : https://github.com/ahmadawais/create-guten-block/issues/133

kubiqsk commented 5 years ago

is there any hotfix? I really need it to work now

adrienlamotte commented 5 years ago

@kubiqsk yes you'll find a solution in the link above ;)

Jaydeep-Trivedi commented 5 years ago

Alternatively, after adding the babel lodash plugin, you could replace import { omit } from lodash with import omit from 'lodash/omit' in deprecated.js file

marcusig commented 5 years ago

I've updated CBG to the latest version, which fixes the issue.