After some digging it turns out that my problem only occurs in Chrome, and only when I’m logged in. I think there’s a conflict with the WordPress admin bar on the front-end for me. In either case, visitors won’t be logging in, and so they won’t encounter this error.
Thanks!