[Resolved] Enqueue / preview issue

Home Forums Support Enqueue / preview issue

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1469417
    Mike

    Hi

    We’re using GP and have built a custom slider Gutenberg block which uses Swiper js. It works fine on the front end but in the Gutenberg editor we get a “this block has encountered an error and cannot be previewed” message when previewing – which we think is because the page can’t find the swiper.js script. No matter what we do we can’t seem to get the enqueue to put the swiper js in the head.

    I wondered if there is anything in GP which we should be aware of which forces script references into the footer – or any tips as to how we might approach this issue? There seems very little on the web to help us!

    Thanks in advance

    Mike

    #1469716
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    That error is usually because of a syntax error in the javascript that renders the block. A missing JS file shouldn’t trigger it.

    For more details on the error, right-click + Inspect the page and look at the Console tab – the editor will give you more info on what’s going on.

    #1471291
    Mike

    Thanks Tom!

    #1471985
    Tom
    Lead Developer
    Lead Developer
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.