Block themes with wp.template = error
-
As always I am using wp.template, but switching to Twenty-two or Twenty-three I got error in my module:
jquery.min.js?ver=3.7.0:2 jQuery.Deferred exception: Invalid or unexpected token SyntaxError: Invalid or unexpected token
at new Function ()
at Function.template (https://contest.evelynwaugh.com.ua/wp-includes/js/underscore.min.js?ver=1.13.4:2:15198)
at https://contest.evelynwaugh.com.ua/wp-includes/js/wp-util.min.js?ver=6.3.1:2:328My code :
const templateSelected = wp.template( 'filled-component' ); const productInfo = { title: product.name, href: product.link, image: product.image, sku: product.sku, stock: product.stock, } productBodyContainer.replaceWith( templateSelected( productInfo ) );
In Twenty-One and older versions everything is ok, I also have dependencies for js script: ‘jquery’, ‘wp-util’, ”wp-hooks’
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Block themes with wp.template = error’ is closed to new replies.