Hey Sasha,
Just wanted to chime in here. It’s possible that a ModSec rule is being triggered when you paste the code into a BB module based on the dev tool console error. Would it be possible for you to get in touch with your hosting company and see if they can turn it off or add an exception?
Let us know how it goes!
Ben