How do I add the JavaScript src file inside a block?
You should add javascript as a library, then attach it to your block in the build array or a preprocess function like this:

$block['#attached']['library'][] = 'mymodule/mymodule.search_filters';
$block['#attached']['drupalSettings']['mymodule'] = [
  'cats' =&gt; 'tabby',
  'dogs' =&gt; 'dalmation',
];