Error Handler Bugsnag

Hey, is there any way we can integrate bugsnag in POS?

Hey @Hassan_Ahmed :waving_hand: - just wanted to clarify, are you looking at integrating Bugsnag in your own code base to track error messaging?

We do send back error messages on our end when it comes to API outputs (for example, malformed syntax, etc), but just wondering what your use case is here.

Hope to hear from you soon - happy to help with this!

Hey @Alan_G, thanks for your response!

We’ve connected our backend API with the POS, which sends us shipping rates. Everything works fine on the development store, but when we deploy it to the actual production store, something breaks. Unfortunately, we’re not seeing any logs or errors—it just fails silently, possibly due to an undefined value.

I tried replicating the issue on the development store by mocking the response, but I couldn’t reproduce the problem.

To catch the error, I tried several approaches:

  • I integrated Bugsnag and wrapped the screen with the Bugsnag error boundary. However, there are some limitations in POS apps. For example, I encountered an error: mimetypes not available.
  • Then I created a serverless function to send error reports. Here’s the code:
self.addEventListener('unhandledrejection', async (event) => {
  const { reason } = event;

  if (reason instanceof Error) {
    await reportError(reason.message, {
      name: reason.name,
    });
  }
});

self.addEventListener('error', async (event) => {
  const error = event.error;

  const message = error?.message || event.message;
  const stack = error?.stack || 'No stack trace available';

  await reportError(message, stack);
});

This code successfully throws errors on the development store, but not on the production store.

I’m looking to properly integrate Bugsnag (or any alternative) so I can catch and fix the error in production. Any suggestions or guidance would be greatly appreciated.

Can you also send runtime errors? The code breaks on screen. I’m attaching screenshots of the production and staging here.


Hey again @Hassan_Ahmed - thanks for the clarification there. We don’t currently offer a specific integration for bugsnag, but we do have a debugging guide here in our documentation for POS Extensions if you haven’t checked that out yet.

You could build a tracker around the console.log output, although debugging is only supported on development shops at the moment. We do also have a list of common errors here that might help for tracking too.

Hope this helps a little bit - let me know if I can clarify anything on my end here :slight_smile:

Thanks @Alan_G ,
Yes i checked all these things.

Question, is there any way i can see logs of POS production app?

Or anything so that i can see what the error is?
Just want to see error message :confused:

Thanks @Hassan_Ahmed just to double‑check: have you tried opening chrome://inspect while the POS app is logged‑in to a partner development store (as described here)?

https://shopify.dev/docs/api/app-bridge/previous-versions/debugging#debugging-in-shopify-point-of-sale-pos

That guide says:

‘The debugging is enabled by default when you log in to a partner development store in Shopify POS. You can open chrome://inspect to inspect the WebView.’

Because that capability is tied to dev‑store login, though are you just looking for similar functionality on the production app? Just wanted to make sure that I’m understanding correctly - at the moment I don’t believe it is possible, but once I hear back from you I can do a bit more digging to confirm.

If you want to use bugsnag, you’ll likely need to try catch around your functions and report the error yourself rather than using the self event listeners

yes @Alan_G , i debug the app using adb, the guide you sent,

@JordanFinners , I have tried that, but Shopify loads the app in a sandbox environment, which has some limitations. I encountered an error: mime-types not available.

Yeah, sorry I meant report it via their API, as you’ll be able to use that as just fetch request.
https://developer.smartbear.com/bugsnag/default/error-reporting-api-overview