Did you get this resolved?
I spun it up on a test site to see if I could spot the error as your code looked fine, it runs fine on my site:
The only difference I made was:
Neither of those should make any difference though.
Maybe the line reference is misreporting and the error comes from somewhere else in the adapter js code? Try chopping it back to the vanilla version you posted and, if that works, build out again from there to see what trips it up.