bugsnag-js
bugsnag-js copied to clipboard
Bugsnag must be removed for mobile footer dropdowns to work when Shopify Chat is installed on Pipeline theme
Describe the bug
Hey team, Tobin from Theme Support here. I was instructed by developers working with the Shopify Inbox app team to post this issue here.
Footer dropdowns for the third party theme Pipeline by Groupthought no longer work when the Shopify Chat widget is present. Removing Bugsnag as a dependency on the Shopify Inbox app seems to resolve the issue. We have received two escalated tickets with this exact issue now. I have a ticket on hold with the merchant from Store #1 (linked below) and the Groupthought developers since it's been a bit of a back and forth about whether it's the app or the theme causing the issue.
Specifically, this line of code in Bugsnag is the cause of the issue.
Theme Support has a Third Party Theme Issue Repo - here is the issue posted there as well.
Store #1 where the issue is active. Store #2 where they have removed footer dropdowns but when they are implemented the issue occurs.
Steps to reproduce
- Travel to this merchant's live theme.
- Attempt to open the footer menu drawers.
- Remove BugSnag and this now functions correctly
(Issue can also be seen on this staging store.)
Environment
- Bugsnag version: @bugsnag/js": "^7.22.3"
- Browser version (e.g. chrome, safari): All browsers
- Device (e.g. iphonex): Mobile devices only - can be replicated on desktop viewing mobile view.
Example code snippet
https://github.com/bugsnag/bugsnag-js/blob/8a70db4747e4ea40e1e9ce128c8b4582d93641f7/packages/plugin-inline-script-content/inline-script-content.js#L125
Hi Bugsnag team,
I'm a Shopify engineer who looked into this issue. I'm here to provide more technical context. Our app (Shopify Inbox) is a script that loads on a merchant's website. Our Inbox app uses Bugsnag as a dependency. We noticed on certain websites using a specific Shopify theme, Bugsnag throws an error TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in this context...
, which causes bugs on websites running our script (like the footer dropdowns not opening on this site on iOS browsers). When we removed Bugsnag as a dependency, these bugs disappear. We definitely want to keep using Bugsnag though so we're hoping your team can provide the fix. Thanks!
Any update or information on this as of yet? We are getting several reports of this now - all accounts utilizing the Pipeline theme by Groupthought.
Hi :wave:
I have raised this with our engineers. we are investigating this further and I will keep you updated once we have more information to share.
Hi everyone,
After some brief investigation, it appears that both our inline script content plugin and the Shopify chat widget monkey patch the addEventListener
methods of many window objects, and I believe that some context with either this
or arguments
is being lost through the multiple layers of patching. This could also be caused by modern browsers using strict mode - but we will need to spend more time investigating to ensure we take the correct approach to resolve this.
In this meantime, you can disable the inline script checking with the trackInlineScripts configuration option, which will prevent the monkey patch from being applied.
Hope this helps!
@gingerbenw and @clr182 turning trackinlinescripts
seemed to have worked for us, thank you!!
Thank you!