Support

Account

Home Forums Gutenberg Gutenberg ACF Blocks – JS Not Working/Loading in Editor/Preview Reply To: Gutenberg ACF Blocks – JS Not Working/Loading in Editor/Preview

  • The issue is no JS files are being loaded from the blocks. The CSS is being loaded for example when viewing page source I see:
    <link rel='stylesheet' id='testimonials-css' href='http://enosix.localhost/wp-content/themes/enosix/dist/blocks/css/testimonials.css?ver=1627702841' media='all' />

    But there is no JS file. So that’s the issue. Does anyone have an example of working JS in the preview? It would seem that

    'enqueue_assets'    => function () {
            wp_enqueue_style( 'team', get_template_directory_uri() . '/dist/blocks/css/team.css', array(), filemtime( get_template_directory() . '/dist/blocks/css/team.css' ), 'all' );
            wp_enqueue_script( 'team', get_template_directory_uri() . '/dist/blocks/js/team.js', array( 'jquery', 'application' ), filemtime( get_template_directory() . '/dist/blocks/js/team.js' ), true );
          },

    Is not working for JS.