Sentry-cordova.bundle.js.map not found crashes iOS app on load (sourcemap not found)


#1

I have a create-react-app wrapped in Cordova, and I added sentry-cordova as per documentation.

I have the following in my index.js, in the ‘deviceready’ event handler:

    window.Sentry = window.cordova.require('sentry-cordova.Sentry');
    window.Sentry.init({
      dsn: 'https://xyz@sentry.io/123', // [redacted]
    });
    window.Sentry.captureMessage('initializing sentry');

    function failingFunction() {
      throw new Error('Sentry Test');
    }

    window.sentry.addBreadcrumb({ message: 'initSentry' });
    try {
      failingFunction();
    } catch (e) {
      window.Sentry.captureException(e);
    }

When I run $ cordova run ios --target=iPad-Air-2 the app freezes as soon as it starts up, and all I get from the connected Safari Web Inspector is the following error:

file:///Users/manus/Library/Developer/CoreSimulator/Devices/61538CF8-9328-4AFD-9E91-83C740D82D7C/data/Containers/Bundle/Application/4CDD2BBE-F19C-4B59-932F-8D5E02FCADE2/MyApp.app/www/plugins/sentry-cordova/dist/js/sentry-cordova.bundle.js.map
Failed to load resource: The requested URL was not found on this server.

I found several posts with a fix for ionic apps, but nothing for a classic JS wrapped app.

If I comment out the lines starting from window.Sentry.captureMessage... to the end of the above snippet, the app works, so Sentry seems really the culprit.

Using sentry-cordova 0.13.1 and cordova 8.1.2