Automattic / Automattic/jetpack
media-views.min.js?ver=5.0:1 Uncaught TypeError: this.activateMode is not a function
- Dominant language
- PHP
- Stars
- 1.8k
- Forks
- 898
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 774
Description
#### Steps to reproduce the issue
1. Run Jetpack in development mode
2. Install GravityForms Gutenberg add-on or any plugin using lodash
3. Create Custom Block with create-guten-block that uses the MediaUpload component
3. Go to the block editor
4. Look in the console to see the following error
```
media-views.min.js?ver=5.0:1 Uncaught TypeError: this.activateMode is not a function
at media-views.min.js?ver=5.0:1
at arrayEach (core.min.js?ver=1544551272:1645)
at Function.forEach (core.min.js?ver=1544551272:10473)
at n._createModes (media-views.min.js?ver=5.0:1)
at n.initialize (media-views.min.js?ver=5.0:1)
at n.initialize (media-views.min.js?ver=5.0:1)
at n.initialize (media-views.min.js?ver=5.0:1)
at n.e.View (backbone.min.js?ver=1.2.3:1)
at n.constructor (wp-backbone.min.js?ver=5.0:1)
at n.constructor (media-views.min.js?ver=5.0:1)
```
#### What I expected
Custom blocks to work fine.
#### What happened instead
`This block encountered an error and cannot be previewed`
Contributor guide
Research direction
Start by reproducing the issue in Jetpack development mode with a Gravity Forms Gutenberg add-on or another lodash-using plugin, then create a custom block with create-guten-block and MediaUpload. Inspect the MediaUpload and media-views initialization path associated with the reported stack trace; done means the custom block previews normally without the activateMode error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100