Trigger a Drupal behavior from another module in Javascript?
Hitting the route with Drupal.ajax results in
  'context.querySelectorAll is not a function.


This happens when Drupal.attachBehaviors() is passed a jQuery object. It expects an HTML string. So if you are doing this:

var element = $(".some_element");
Drupal.attachBehaviors(element);


You change it to:

$(".some_element").each(function () {
  Drupal.attachBehaviors($(this).eq(0));
});