Hi @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 Jetpack enqueues here 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.