I have made a block and all is working ok except I added an inline script inside 'dc-carousel-block-template.php'. I tried running this but found this does not work. It works if I run it inside 'enqueue_script' or 'enqueue_assets'. Is there an issue running inline scripts? or is this just WordPress preventing it?
It looks like WordPress does not support running the inline script when previewing block content (it works on the frontend). You should use the setting enqueue_script to enqueue your script when registering the block. Read more on the documentation https://docs.metabox.io/extensions/mb-blocks/#enqueue_script