sentry-react-native icon indicating copy to clipboard operation
sentry-react-native copied to clipboard

Converting to epub: Interrupted operation as its client disconnected

Open krystofwoldrich opened this issue 1 year ago • 0 comments

Description

Metro currently doesn't support tree shaking out of the box. And so all @sentry/* dependencies are included in the final bundle.

Some packages can be easily excluded using the metro resolver options:

Current solution

const config = {
  resolver: {
    resolveRequest: (context, moduleName, platform) => {
      if (moduleName.includes('@sentry/replay')) {
        return { type: 'empty' };
      }
      return context.resolveRequest(context, moduleName, platform);
    },
  },
};

Proposed solution

Sentry Metro config will automatically remove web replay for mobile platforms and expose an option to remove it for web builds.

const { withSentryConfig } = require('@sentry/react-native/metro');

const m = mergeConfig(getDefaultConfig(__dirname), config);
module.exports = withSentryConfig(m, { includeReplay: true });

krystofwoldrich avatar Mar 27 '24 10:03 krystofwoldrich