Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I don't see the attach_library twig extension having a second parameter. Look for the implementation of the twig extension above in Drupal\Core\Template\TwigExtension.php in the function attachLibrary. What version of twig are you using? I'm in Drupal 8.2.1.
I will not accept my answer because the above solution doesn't get cleared when the widget no longer exists on a page (in my case a View). Oh, also notice I used an inline_template instead of creating another .html.twig file. The template used is actually much more complex that what I showed. Technically don't need to add a '#context', I know.