Custom gutenberg block doesn’t load viewScript file on the frontend even though it’s defined in blocks.json

I’ve been struggling with this for hours. I used the @wordpress/create-block package to generate a template for me to create my first block. I’ve managed to create a hero block with an image uploader etc.

However, now I’ve come to the point where I need to actually add JS to the frontend in order to make the image carousel functionality. For some reason unknown to me, my view.js file absolutely refuses to load up in the frontend.

With loading I mean doesn’t appear in HTML, and doesn’t show up in the network tab.

I’ve searched everywhere.

  • According to the docs it’s correctly defined in my blocks.json.
  • I’m not using a render_callback in my register_block_type, so I shouldn’t have to enqueue it myself manually.
  • I’ve removed and reinserted the block about 100 times thinking it was cache or whatever.

It’s just no use. The plugin directory for my custom block is right here: https://github.com/Danielvandervelden/wp-template/tree/master/wp-content/plugins/hero if you have a moment I’d very much appreciate any help in order to get this resolved.

Thank you!