Home › Forums › Gutenberg › js fires before block is rendered › Reply To: js fires before block is rendered
I actually had exactly the same issue after creating a slideshow block with slick, as well as all of my other blocks that use javascript.
The problem was, I copied and pasted the wp_enqueue_script some documentation at some point and I had (notice the lack of a version #):
wp_enqueue_script( 'slideshow-block-library', get_template_directory_uri() . '/template-parts/block/js/slick.min.js', array('jquery'), true );
When I should have had:
wp_enqueue_script( 'slideshow-block-library', get_template_directory_uri() . '/template-parts/block/js/slick.min.js', array('jquery'), '1.0.0', true );
For more info, see the WordPress Docs here.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.