Title: Javascript error in Gutenberg
Last modified: May 4, 2022

---

# Javascript error in Gutenberg

 *  Resolved [flyplugins](https://wordpress.org/support/users/flyplugins/)
 * (@flyplugins)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/javascript-error-in-gutenberg/)
 * When JetPack is enabled, the S3 Media Maestro plugin will not render the Gutenberg
   block. When using:
 * add_filter( ‘jetpack_gutenberg’, ‘__return_false’ );
 * the issue is resolved, however, it would seem this is not a permanent solution.
 * Errors:
    Uncaught TypeError: Cannot set properties of undefined (setting ‘s3mm_mejs’)
   Uncaught TypeError: Cannot read properties of undefined (reading ‘_babelPolyfill’)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [Mehdi Benchalal](https://wordpress.org/support/users/muffinpeace/)
 * (@muffinpeace)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/javascript-error-in-gutenberg/#post-15616407)
 * Hi [@flyplugins](https://wordpress.org/support/users/flyplugins/)
 * I’ve seen you are having an issue with the Gutenberg Block not being rendered
   correctly when using the S3 Media Maestro while Jetpack is active.
 * Did you try testing with a default theme such as Twenty Seventeen? You can go
   ahead with that to see if it’s a conflict happening between your theme and Jetpack.
 * Let us know what you find.
 *  Thread Starter [flyplugins](https://wordpress.org/support/users/flyplugins/)
 * (@flyplugins)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/javascript-error-in-gutenberg/#post-15616521)
 * Hi [@muffinpeace](https://wordpress.org/support/users/muffinpeace/)
    Yes, we’ve
   attempted to use default theme (Twenty Seventeen) and have deactivated all other
   plugins as well with no change.
 *  Plugin Contributor [Stef (a11n)](https://wordpress.org/support/users/erania-pinnera/)
 * (@erania-pinnera)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/javascript-error-in-gutenberg/#post-15618681)
 * Hi [@flyplugins](https://wordpress.org/support/users/flyplugins/),
 * Thanks for trying that.
 * It would be helpful to have a reproducible case to see what’s going on.
 * If you can send us a zip of the plugin, provide a link to the source code, or
   a code snippet that reproduces the error, we’ll be happy to look at what the 
   conflict might be.
 * We have a secure way to get this data to us, via a bespoke pastebin link we can
   generate, but in order to share this with you, we need you to contact us directly.
 * Could you please [use this contact form](https://jetpack.com/contact-support/?rel=support&hpi=1)
   and mention this thread?
 * Thanks a lot!
 *  Thread Starter [flyplugins](https://wordpress.org/support/users/flyplugins/)
 * (@flyplugins)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/javascript-error-in-gutenberg/#post-15623193)
 * Hi [@erania-pinnera](https://wordpress.org/support/users/erania-pinnera/),
    I’ve
   sent over the requested info using the contact form.
 * Thank you!
    Ben
 *  Plugin Contributor [Derek Smart](https://wordpress.org/support/users/dsmart/)
 * (@dsmart)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/javascript-error-in-gutenberg/#post-15633154)
 * Hi [@flyplugins](https://wordpress.org/support/users/flyplugins/), took a look
   at the code and the site you set up. Thanks for that!
 * After enabling the `SCRIPT_DEBUG` constant on the site (did so via a plugin, 
   still active on the test site), there’s a bit more context. This one particularly
   caught my eye:
 *     ```
       Uncaught ReferenceError: S3mmEvents is not defined
           at S3MediaEditBlock.componentDidMount
   
       The above error occurred in the <S3MediaEditBlock> component:
           at S3MediaEditBlock (webpack-internal:///./assets/js/src/blocks/s3media/index.js:231:5)
           at edit
       ```
   
 * [This script](http://widgets.wp.com/wpcom-block-editor/default.editor.js?minify=false)
   Jetpack [enqueues here](https://github.com/Automattic/jetpack/blob/master/projects/plugins/jetpack/modules/wpcom-block-editor/class-jetpack-wpcom-block-editor.php#L70)
   seems to be the conflict of this S3MediaEditBlock component. I tried to follow
   your code a bit, and think that it’s meant to be loading in `window.S3mmEvents`
   somehow through Vue? Not sure there, but you can see the window property is undefined
   when the Jetpack file is enqueued.
 * Often times it’s a load order issue that conflicts like this, and thought perhaps
   loading your scripts earlier might help. In the `s3-media-maestro/includes/Shortcode.
   php` file, there’s a lot of methods calling the `->get_builder_scripts()` which
   enqueues stuff in the footer by default.
 * **TLDR:** I found a potential fix by passing `false` in the `$this->get_builder_scripts()`
   call on line 2071 of `s3-media-maestro/includes/Shortcode.php` – within the `
   builder_scripts()` method. With that context enqueuing in the header, the video
   loads as expected and there are no console errors.
 * Hoping this helps some! Maybe you’ll have better luck debugging. I’m not seeing
   anything unusual with how Jetpack is enqueuing these assets.
 *  [deathlynotes](https://wordpress.org/support/users/deathlynotes/)
 * (@deathlynotes)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/javascript-error-in-gutenberg/#post-15640713)
 * Hi,
 * Since the issue is being addressed via our Helpdesk, I am closing the issue.
 * Let me know if you have any questions.
 * My best regards,
 * Michelle

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Javascript error in Gutenberg’ is closed to new replies.

 * ![](https://ps.w.org/jetpack/assets/icon.svg?rev=2819237)
 * [Jetpack - WP Security, Backup, Speed, & Growth](https://wordpress.org/plugins/jetpack/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/jetpack/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/jetpack/)
 * [Active Topics](https://wordpress.org/support/plugin/jetpack/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/jetpack/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/jetpack/reviews/)

 * 6 replies
 * 5 participants
 * Last reply from: [deathlynotes](https://wordpress.org/support/users/deathlynotes/)
 * Last activity: [3 years, 11 months ago](https://wordpress.org/support/topic/javascript-error-in-gutenberg/#post-15640713)
 * Status: resolved