Giter VIP home page Giter VIP logo

sentry-cordova's Introduction

Sentry

Official Sentry SDK for Cordova (Ionic, ...)

Bad software is everywhere, and we're tired of it. Sentry is on a mission to help developers write better software faster, so we can get back to enjoying technology. If you want to join us Check out our open positions

build codecov npm version npm dm npm dt

This is a beta release

Usage

Cordova in index.html onDeviceReady function:

onDeviceReady: function() {
    ...
    var Sentry = cordova.require("sentry-cordova.Sentry");
    Sentry.init({ dsn: '___PUBLIC_DSN___' });
    ...
}

Ionic in your app.module.ts:

...
import * as Sentry from 'sentry-cordova';
...
Sentry.init({ dsn: '___PUBLIC_DSN___' });

Documentation

sentry-cordova's People

Contributors

abhiprasad avatar akshitkrnagpal avatar alexbonhomme avatar asottile-sentry avatar backspace avatar balaclark avatar blackwolf12333 avatar brownoxford avatar bruno-garcia avatar dependabot[bot] avatar eimermusic avatar esbakker avatar getsentry-bot avatar hazat avatar jan-auer avatar jennmueng avatar lobsterkatie avatar lucas-zimerman avatar mattgauntseo-sentry avatar mattjohnsonpint avatar maxbittker avatar mikaelbartlett avatar mikejpeters avatar mitsuhiko avatar pavrda avatar rhcarvalho avatar schmitzt3 avatar snyk-bot avatar tonyo avatar wslaghekke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sentry-cordova's Issues

Android sentry error submissions all returning 404

I've got the Cordova plugin installed and it seems to be working fine on iOS - I've been able to fire of some simulated and actual errors and they get captured by Sentry. On Android, however, any time my app tries to submit an error to Sentry it throws a 404. Specifically, I've tried:

Sentry.getSharedClient().captureException(new Error('something bad happened'))

and

Sentry.getSharedClient().captureMessage('uh oh')

These fire off a POST request to:

https://sentry.io/api/[MY APP ID]/store/?sentry_version=7&sentry_client=raven-js%2F3.22.1&sentry_key=[MY SENTRY KEY]

except it contains my actual app ID and key - every time, I get a 404 Not Found. Is this a bug or did I do something wrong in my config?

Error: exec proxy not found for :: Sentry :: install

Not sure what I'm doing wrong. In my Cordova project I put the code needed in the project:

onDeviceReady: function() {
    ...
    var Sentry = cordova.require("sentry-cordova.Sentry");
    Sentry.init({ dsn: '___PUBLIC_DSN___' });
    ...
}

And

<access origin="sentry.io" /

in my config.xml

But each time I run the project in the browser (haven't tried other platforms) I am getting a console log

Error: exec proxy not found for :: Sentry :: install                    cordova.js:1003:9

whereas everything else is working fine up until then. I've tested it and this is happening in Chrome and Firefox.

Any idea why? I've tried using my dsn multiple ways also and it doesn't seem to make a difference.

Remove plugin

How can I remove the plugin ?

I am prompt by the Sentry wizard..

pc41:Croustillant-Ionic thomas$ cordova plugin rm sentry-cordova
no URL provided, fallback to https://sentry.io/
Running Sentry Wizard...
version: 0.9.3 | sentry-cli version: 1.30.3
Please copy/paste your organization slug
It can be found in the url https://sentry.io/organization_slug/project_slug
? Organization Slug: 

Uncaught module cordova-plugin-sentry.SentryCordovaBundle not found

Hi,

I installed and configured succesfully Sentry for cordova. Howewer Chrome DeveloperTools for virtual android returns error

Uncaught module cordova-plugin-sentry.SentryCordovaBundle not found

Sentry initiation is triggered on index.html

  document.addEventListener('deviceready', function() {
                var Sentry = cordova.require("cordova-plugin-sentry.SentryCordovaBundle").default;
                var SentryBrowser = cordova.require("cordova-plugin-sentry.SentryCordovaBundle").SentryBrowser;
                var SentryCordova = cordova.require("cordova-plugin-sentry.SentryCordovaBundle").SentryCordova;

                Sentry.create('___DSN___')
                .use(SentryCordova, {sentryBrowser: SentryBrowser})
                .install();
            });

package.json

{
  "name": "com.ordinnery.mobile",
  "version": "1.0",
  "displayName": "Zwyczajny.pl",
  "cordova": {
    "platforms": [
      "windows",
      "android"
    ],
    "plugins": {
      "cordova-plugin-geolocation": {},
      "cordova-plugin-inappbrowser": {},
      "cordova-plugin-android-permissions": {},
      "cordova-plugin-browsertab": {},
      "onesignal-cordova-plugin": {},
      "cordova-plugin-network-information": {},
      "cordova-plugin-dialogs": {},
      "cordova-plugin-whitelist": {},
      "cordova-plugin-facebook4": {
        "APP_ID": "1274762585944081",
        "APP_NAME": "Zwyczajny.pl"
      },
      "cordova-plugin-is-debug": {},
      "sentry-cordova": {}
    }
  },
  "dependencies": {
    "@sentry/cordova": "^0.6.0",
    "android-versions": "^1.2.2",
    "cordova-android": "^6.3.0",
    "cordova-plugin-android-permissions": "^1.0.0",
    "cordova-plugin-browsertab": "^0.2.0",
    "cordova-plugin-compat": "^1.2.0",
    "cordova-plugin-dialogs": "^2.0.1",
    "cordova-plugin-facebook4": "^1.7.4",
    "cordova-plugin-geolocation": "~1.0.1",
    "cordova-plugin-inappbrowser": "^1.7.2",
    "cordova-plugin-is-debug": "^1.0.0",
    "cordova-plugin-network-information": "^2.0.1",
    "cordova-plugin-whitelist": "^1.3.3",
    "cordova-windows": "~5.0.0",
    "onesignal-cordova-plugin": "^2.2.2"
  }
}

no URL provided, fallback to https://sentry.io/, Running Sentry Wizard...

Hello @HazAT,

I have successfully installed Sentry for Cordova/Ionic following the official documentation. However, each time I run an Ionic command (ionic cordova emulate, ionic cordova build...):

no URL provided, fallback to https://sentry.io/
Running Sentry Wizard...
version: 0.7.5 | sentry-cli version: 1.28.1
Sentry Wizard will you help to configure your project
Thank you for using Sentry :)
? Select the platforms you like to set up: (Press <space> to select, <a> to togg
le all, <i> to invert selection)
❯◉ iOS
 ◉ Android

And the CLI is KO, I must CTRL+C it to get out.

What's the URL? Do I need to enter it somewhere manually?

Thanks

Error: Cannot find module '@sentry/wizard'

I am trying to do a clean cordova platform add android with version 0.7.0 and am getting the following error when it tries to install sentry-cordova:

Failed to install 'sentry-cordova': Error: Cannot find module '@sentry/wizard'
    at Function.Module._resolveFilename (module.js:527:15)
    at Function.Module._load (module.js:476:23)
    at Module.require (module.js:568:17)
    at require (internal/module.js:11:18)
    at module.exports (/Users/project/plugins/sentry-cordova/scripts/before_plugin_install_uninstall.js:2:18)
    at runScriptViaModuleLoader (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:188:18)
    at runScript (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:164:16)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:132:20
    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
Error: Cannot find module '@sentry/wizard'

Error when adding plugin to Ionic 1 project

Error during processing of action! Attempting to revert...
Failed to install 'sentry-cordova': Error: Uh oh!
ENOENT: no such file or directory, open 'C:\code\mobile-app\vac-mobile-app\main-project\plugins\sentry-cordova\www\SentryCordova.js'
at Error (native)
at Object.fs.openSync (fs.js:642:18)
at Object.fs.readFileSync (fs.js:510:33)
at install (C:\code\mobile-app\vac-mobile-app\main-project\platforms\android\cordova\lib\pluginHandlers.js:173:36)
at Object.process (C:\code\mobile-app\vac-mobile-app\main-project\platforms\android\cordova\node_modules\cordova-common\src\ActionStack.js:56:25)
at PluginManager.doOperation (C:\code\mobile-app\vac-mobile-app\main-project\platforms\android\cordova\node_modules\cordova-common\src\PluginManager.js:114:20)
at PluginManager.addPlugin (C:\code\mobile-app\vac-mobile-app\main-project\platforms\android\cordova\node_modules\cordova-common\src\PluginManager.js:144:17)
at C:\code\mobile-app\vac-mobile-app\main-project\platforms\android\cordova\Api.js:243:74
at _fulfilled (C:\code\mobile-app\vac-mobile-app\main-project\platforms\android\cordova\node_modules\q\q.js:854:54)
at self.promiseDispatch.done (C:\code\mobile-app\vac-mobile-app\main-project\platforms\android\cordova\node_modules\q\q.js:883:30)
Error: Uh oh!
ENOENT: no such file or directory, open 'C:\code\mobile-app\vac-mobile-app\main-project\plugins\sentry-cordova\www\SentryCordova.js'

It's not clear from the docs if offline exception tracking is supported

I was assuming that when the device is offline the plugin will store expcetions and fire those to Sentry when the device is back online. Is that how it's working?

Anyway, when reporting exceptions when offline the following error appears on the console:
Uncaught (in promise) Error: Sentry error code: network unavailable(…)

Removing and readding platform does not work

Because the cordova plugin "cordova-plugin-sentry" and the npm-package "@sentry/cordova" live under the same package, cordova and npm get into trouble when trying to restore a platform.

This can be fixed by publishing the cordova-plugin under a new name on npm. "cordova-plugin-sentry" is already taken by another package so a slight name change would be necessary.

Native call errors are swallowed

Any errors calling native code are swallowed:

}).catch(e => {
if (
(e === 'not implemented' || e === 'Cordova.exec not available') &&
(this.browserBackend as any)[action]
) {
// This is our fallback to the browser implementation
return (this.browserBackend as any)[action](...args);
}
});

There should probably be an else statement to handle the error in case it's not 'not implemented' or 'Cordova.exec not available'. I guess the error should be re-thrown, but that will still result in an uncaught promise error during CordovaBackend#install() .

I think it would be nice to have Sentry.create() return a promise that can be rejected in case of an error. However I'm not sure how to go about creating a pull request to do that. I have an idea how to improve CordovaBackend but for it to be useful it would require changing the Backend interface and the createAndBind method, both part of @sentry/core.

--- src/js/backend.ts	(revision cf004f539306b8cf1e12155baad18a128f05ffda)
+++ src/js/backend.ts	(date 1522181912717)
@@ -35,15 +35,19 @@
   /**
    * @inheritDoc
    */
-  public install(): boolean {
-    this.browserBackend.install();
+  public install(): Promise<void> {
+    return new Promise((resolve, reject) => {
+      this.browserBackend.install();
 
-    if (this.isCordova()) {
-      this.deviceReadyCallback = () => this.runNativeInstall();
-      document.addEventListener('deviceready', this.deviceReadyCallback);
-    }
-
-    return true;
+      if (this.isCordova()) {
+        this.deviceReadyCallback = () => {
+          this.runNativeInstall().then(resolve).catch(reject);
+        };
+        document.addEventListener('deviceready', this.deviceReadyCallback);
+      } else {
+        resolve();
+      }
+    });
   }
 
   /**
@@ -93,18 +97,22 @@
       ) {
         // This is our fallback to the browser implementation
         return (this.browserBackend as any)[action](...args);
+      } else {
+        throw e;
       }
     });
   }
 
-  private runNativeInstall(): void {
+  private runNativeInstall(): Promise<any> {
     document.removeEventListener('deviceready', this.deviceReadyCallback);
     if (this.frontend.getDSN()) {
-      this.nativeCall(
+      return this.nativeCall(
         'install',
         this.frontend.getDSN()!.toString(),
         this.frontend.getOptions(),
       );
+    } else {
+      return Promise.reject(new Error('DSN not configured'));
     }
   }
 

Mismatch app version and version in bug metadata

I have an issue with not working source map. After some debug I found that the issue because on mismatch app version and version in bug metadata.

  1. On build app "sentry-cordova" not use app version from config.xml, instead generate another release ID:
Uploading assets release: 'c007dee641852e6e3039' path: /my_projects/xxx-mobile/platforms/ios/www

release_c007dee641852e6e3039___chiplists-angular

src/index.html

<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
    <script>
    (function(w){var i=w.SENTRY_RELEASE=w.SENTRY_RELEASE||{};i.id='c007dee641852e6e3039';})(this);
    </script>
    <!-- sentry-cordova -->
  <meta charset="UTF-8">
...

config.xml

<?xml version='1.0' encoding='utf-8'?>
<widget id="xxx.xxx.xxx" version="0.1.50" 
  1. The exception from production without working source map:

typeerror__undefined_is_not_an_object__evaluating__e_chat_userstatistics__

release_com_chiplists_mobile-0_1_50___chiplists-angular

How I can fix this mismatch with app versions

[Feature request] Offline error catching support

One big difference between the web and the cordova contexts is that even though we are using the same languages and techs (js, css, html...), we are very often working in a offline of semi-offline environment with Cordova apps.

It would thus be very logical that this plugin caches the errors catch when the cordova app is offline in order to send them to Sentry another day (as soon as it gets back a network connection).

When first "discovering" this plugin, I thought it was already the case actually...

Android app hangs (infinite loop)

When I run my cordova app on Android with sentry-cordovda 0.8.4 it hangs. When I run adb logcat I see the following being continuously logged in an infinite loop:

[INFO:CONSOLE(2)] "not implemented", source: file:///android_asset/www/plugins/sentry-cordova/dist/js/sentry-cordova.bundle.min.js

Adding the console.error in 82530d2 seems to have caused this. Here is what I think is happening:

  1. addBreadcrumb() is called
  2. Android plugin throws "not implemented"
  3. BrowserBackend has no addBreadcrumb method so it can't fallback to browser implementation (?)
  4. console.error is called, but it's monkey-patched by raven-js and ends up calling addBreadcrumb again somehow

"t is not a function"

I'm having this when calling Sentry.captureMessage("..."):

Uncaught (in promise) TypeError: t is not a function
    at sentry-cordova.bundle.min.js:2

screen shot 2018-04-30 at 16 21 16

screen shot 2018-04-30 at 16 22 04

Why?

Error "Invalid DSN" with Android

Hi,

Plugin works great with iOS but I got this issue in the console of my Android device

Uncaught exception from plugin io.sentry.dsn.InvalidDsnException: Invalid DSN, the following properties aren't set '[secret key]'

My DSN is set like that in app.component.ts

this.platform.ready().then(() => {
      Sentry.create({
        dsn: "myDSN"
      });
});

Environment :

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : 8.0.0 

local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms  : android 7.0.0 ios 4.5.4
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    ios-deploy        : 1.9.2 
    ios-sim           : 6.0.0 
    Node              : v9.5.0
    npm               : 5.6.0 
    OS                : macOS High Sierra
    Xcode             : Xcode 9.2 Build version 9C40b 

403 and JSON.stringify()ing error

I followed all instructions for our Ionic app here, and it works perfectly on web. However, whenever I build it (at least for iOS), I get the following errors:

Sentry - Error:: Request failed: Error Domain=SentryErrorDomain Code=106 "Request errored with 403" UserInfo={NSLocalizedDescription=Request errored with 403}

and

ERROR: error JSON.stringify()ing argument: TypeError: JSON.stringify cannot serialize cyclic structures.

Any ideas where these are coming from? I'm building with the usual ionic cordova build ios

Unable to install via NPM

I'm trying to install sentry for an ionic project and i'm getting this error.
I tried yesterday and today.

> cordova plugin add sentry-cordova --save
Error: Failed to fetch plugin sentry-cordova via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: npm: Command failed with exit code 254 Error output:
WARN registry Unexpected warning for https://registry.npmjs.org/: 
Miscellaneous Warning EINTEGRITY:
 sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4= integrity checksum failed when using sha1: 
wanted sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4 = but got sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==. (1972 bytes)

Missing Sentry.framework on iOS

Hi!

I can't install the plugin on iOS platform. I got the following message.

Cannot find framework "/Users/alex/Development/1_ALEX-ET-MANON/lab/Vliller/vliller/plugins/cordova-plugin-sentry/src/ios/Carthage/Build/iOS/Sentry.framework" for plugin cordova-plugin-sentry in iOS platform

I tried with the last version 0.1.1 using ionic cordova plugin add @sentry/cordova --save

Contexts don't seem to work with Ionic

Trying to send contexts like so:

import * as Sentry from 'sentry-cordova'

...

Sentry.setUserContext(...)
Sentry.setTagsContext(...)

I don't see any extra information in my events nor on the HTTP request.

Okay, I see what I did wrong here. I am trying to turn off sentry at runtime by running Sentry.create({ dsn: '...' }) but doing so gets rid of the contexts. Is there a way to disable sentry runtime? Like set the DSN to a blank string? I don't see any function on the Sentry object to do this...

Uncaught SyntaxError on Android devices

Just tried to setup the Cordova plugin for the first time, on iOS everything seems to work great and I can see the errors on my Sentry console. With my Android devices I get this errors on developer tools console.

plugins/sentry-cordova/dist/js/sentry-cordova.bundle.min.js:2 Uncaught SyntaxError: missing ) after argument list 2018-04-01 10:51:23.672 cordova.js:1461 Uncaught Error: Module sentry-cordova.Sentry does not exist.

Is there anything I am missing? the installation instructions were pretty straightforward.

Ionic missing sourcemap in prod mode

Hey,

There is an issue during compilation with --prod flag on ionic. As Ionic do not include sourcemaps in production release, sentry-wizard try to access to missing files.

Error: ENOENT: no such file or directory, open '/Users/alex/Development/1_ALEX-ET-MANON/lab/Vliller/vliller/platforms/android/assets/www/build/main.js.map'

Could we switch off the sourcemap upload ? With a flag for example ?

Thanks!

Cannot read property ‘_globalOptions’ of undefined

Trying to get sentry-cordova setup, but I'm hitting issues. Here's my code to initialize

const _initSentry = () => {
    window.initLogs.push(`${new Date()}: Sentry Initialization Start`);
    const Sentry = cordova.require('sentry-cordova.SentryCordovaBundle').default;
    const SentryBrowser = cordova.require('sentry-cordova.SentryCordovaBundle').SentryBrowser;
    const SentryCordova = cordova.require('sentry-cordova.SentryCordovaBundle').SentryCordova;

    Sentry.create(`${sentryUrl}`)
        .use(SentryCordova, {sentryBrowser: SentryBrowser})
        .install()
        .then((client) => {
            window.initLogs.push(`${new Date()}: Sentry Initialization Success`);
            client.captureException(new Error('hello sentry'));
        })
        .catch((e) => {
            window.initLogs.push(`${new Date()}: Sentry Initialization Failure - ${e.message}`);
        });
};

which is triggered in

document.addEventListener('deviceready', () => {
    ...
    _initSentry();
    ...
});

After debugging the code I find myself in SentryCordova.bundle.js:4185 with SentryCordova.prototype.nativeCall entering it's catch method with e === 'not implemented' evaluating to true.

I have no idea where to go from here. Hopefully I'm just doing something wrong. If you need more information, please ask :)

after_prepare hook does only upload 5 hardcoded js source files and sourcemaps

let includes = [];

This works pretty well for a standard ionic/cordova project without different bundles, in a more advanced scenario there are multiple bundles with their own sourcemap, e.g.

  • 0.js
  • 0.js.map
  • 1.js
  • 1.js.map
  • 2.js
  • 2.js.map
  • ...

To also cover this scenario the files uploaded to a release should not be predefined, the build directory should be looped through. Something like this should do the trick:

// Adding files to include
let includes = [];
fs.readdir(buildPath, function (error, files) {
  if (error) {
    console.error('Could not list files of build directory: ', buildPath);
  }

  files.forEach(function(file, index) {
    let f = path.basename(file);
    let [name, ext1, ext2] = f.split('.');
    // we only want js source files and the according sourcemaps (no css etc.)
    if (ext1 === 'js' || (ext1 === 'js' && ext2 === 'map')) {
      // ignore sw-toolbox file
      if (name !== 'sw-toolbox') {
        includes.push(path.join(buildPath, f));  
      }
    }
  });
});

Setting the environment

Not seeing this anywhere in cordova docs - how do I set the environment?

I've tried without luck:

      Sentry.init({
        dsn: ...,
        environment: "dev"
      })

Nothing sent with no errors

I just installed the sentry-cordova plugin and can't get it to send anything to my server. I'm monitoring network traffic and nothing happens. I have equivalent web/javascript Raven functionality working just fine pointed at the same DSN. <access origin="*" /> in config.xml. I'm trying to debug sentry-cordova.bundle.js but there are no inline comments to help me. (The Typescript files don't look much more helpful, if I knew Typescript.)

Here's what I see from instrumenting the code with console.logs while running on an iPhone 5S:

  • My code calls Sentry.captureException(e)
  • exported captureException runs, uses invokeClientAsync() to run FrontendBase.prototype.captureException()
  • that calls BrowserBackend.prototype.eventFromException(), which returns an __awaiter (??) with a __generator (??) that replaces existing _sendProcessedPayload with a function that sets event_1 to be the passed-in event, ready to send
  • that calls the "real" Raven.captureException(), which does the actual work of processing the exception, formatting it to send over the wire, building the necessary target URL, etc.
  • _send() is called, which calls _sendProcessedPayload
  • _sendProcessedPayload would normally complete the send process as expected, but because it was (temporarily) set to that lambda function above, it just sets that random event_1 to be the event that would have been sent, then returns.
  • We're back in the __generator which returns [2 /return/, normalizeRavenEvent(event_1)], theoretically to be consumed by someone somewhere, but it appears to be dropped
  • the __generator restores _sendProcessedPayload to what it was originally, "cleaning up" (though it'll just be set back the next time)
  • invokeClientAsync() returns, but the then() inside it is never run; the call/errorback never happens

cordova 7.1.0, cordova-ios 4.5.4. My app uses Angular. Any help appreciated, thanks.

Sentry.captureException Error (iOS)

I had opened a similar issue for Android and that's now resolved, but iOS is still having issues.

const _initSentry = () => {
    window.Sentry = cordova.require('sentry-cordova.Sentry');
    window.Sentry.create({
        dsn: 'https://[email protected]/303006',
        release: APP_VERSION // eslint-disable-line
    });
    window.Sentry.captureException(new Error('Sentry Initialized'));
};

ouputs

TypeError: n.sent is not a function. (In 'n.sent()', 'n.sent' is undefined) (anonymous function) — sentry-cordova.bundle.min.js:327 d — app.js:14 (anonymous function) — app.js:12:427 g — app.js:12:185 promiseReactionJob

ES5 compatibility

It looks like this plugin only supports ES6 (there are const keywords in the dist code). This breaks on iOS< 10

Installing Plugin in Corber.io project blows up

Discovered plugin "sentry-cordova" in config.xml. Adding it to the project
Installing "sentry-cordova" for android
Error during processing of action! Attempting to revert...
Failed to install 'sentry-cordova': Error: Uh oh!
ENOENT: no such file or directory, open '/Users/josh/Documents/projects/fe/my-ember-project/corber/cordova/plugins/sentry-cordova/www/SentryCordova.js'

I believe it is because the generated www folder from yarn dist never gets run

Failed to load resource in iOS safari console

I'm getting a console error when opening the console via safari when building for iOS. I don't think it's breaking anything, but it might be something that could be fixed. I'm using version 0.10.2 of this plugin.

screen shot 2018-06-07 at 4 00 08 pm

setRelease/Version/Dist not working correctly in Android

Calling Sentry.setRelease, setVersion, setDist under iOS results in setting the appropriate tags in the events submitted to Sentry. But under Android, these just show up under the Additional Data section with keys like __sentry_release.

Also, these methods are undocumented.

Constant errors with 0.7.0

After upgrading to v0.7.0 I am constantly getting the following error in a loop:

Unhandled Promise rejection: this.isSetup is not a function ; Zone: <root> ; Task: Promise.then ; Value: TypeError: this.isSetup is not a function

Promises & Android 4.4

Android 4.4 has - Uncaught ReferenceError: Promise is not defined.
Could you please produce es5 build-version additionally

Default release version

Hey,

The release version seems to be automatic and a random string in index.html.
The doc says

Note that we try to set the release dynamically in the index.html but if it fails you should call setRelease.

But setRelease() is called in the app code and sentry-cli has already uploaded the sourcemaps with the randomly generated id.

I think that it would be better if the sentry-cli get the release id from version in package.json or config.xml.

See ya!

Cannot run cordova run browser -- --live-reload

Hey guys.

When running cordova run browser -- --live-reload

I get

Error when parsing /Users/raul/src/er-prism-cordova/platforms/ios/EverReal/Plugins/sentry-cordova/Sentry.framework/Info.plist TypeError: Cannot read property 'nodeName' of null
    at Object.parse (/Users/raul/src/er-prism-cordova/node_modules/plist/lib/parse.js:45:27)
    at Patcher.<anonymous> (/Users/raul/src/er-prism-cordova/plugins/cordova-plugin-browsersync/lib/utils/Patcher.js:103:30)
    at Patcher.<anonymous> (/Users/raul/src/er-prism-cordova/plugins/cordova-plugin-browsersync/lib/utils/Patcher.js:45:16)
    at Array.forEach (<anonymous>)
    at Patcher.<anonymous> (/Users/raul/src/er-prism-cordova/plugins/cordova-plugin-browsersync/lib/utils/Patcher.js:43:12)
    at Array.forEach (<anonymous>)
    at Patcher.__forEachFile (/Users/raul/src/er-prism-cordova/plugins/cordova-plugin-browsersync/lib/utils/Patcher.js:39:20)
    at Patcher.fixATS (/Users/raul/src/er-prism-cordova/plugins/cordova-plugin-browsersync/lib/utils/Patcher.js:101:17)
    at Patcher.patch (/Users/raul/src/er-prism-cordova/plugins/cordova-plugin-browsersync/lib/utils/Patcher.js:119:10)
    at /Users/raul/src/er-prism-cordova/plugins/cordova-plugin-browsersync/lib/pluginHook.js:91:17

Sentry-cordova version: 0.10.0
Cordova version: 8.0.0

What other info do you need from me?

Cannot uninstall plugin

It will get stuck when asking for the DSN: Missing secret in DSN. Even if I give the correct full DSN...

sentry.properties does not exist, please run `sentry-wizard -i cordova`

When trying to deploy an ionic app, I always get this error:
Sentry: sentry.properties does not exist, please run sentry-wizard -i cordova

Running ./node_modules/@sentry/wizard/dist/bin.js -i cordova does not fix the problem, my plugins/sentry-cordova/sentry.properties file looks like this:

defaults.url=https://sentry.io/
defaults.org=XXX
defaults.project=XXX
auth.token=XXX
cli.executable=node_modules/@sentry/cli/bin/sentry-cli

Installation with on-premise Sentry

Hi,
I'm glad to see Sentry is now working on an official plugin for Cordova!

Unfortunately, I ran into some problems trying to use it. When I run cordova plugin add @sentry/cordova, it automatically launches the wizard and tries to connect me to the official Sentry instance, but we have our own instance on premise so that doesn't work.
So I disabled the wizard and ran the installation again, but during the iOS installation I got the following error:

Failed to install 'sentry-cordova': Error: ENOENT: no such file or directory, open '/Users/yannick/Code/…/plugins/sentry-cordova/sentry.properties'

I assumed this file is supposed to be created by the wizard, so I tried running it manually. It seemed to work, but I have no idea where all the information I entered went. When I tried to run cordova prepare, I received the missing sentry.properties error again.

So I have a few questions:

  • Am I doing something wrong?
  • Is there a way to pass options to the sentry wizard when running cordova add plugin / cordova prepare?
  • Where is the configuration stored? I need to add it to version control somehow. (edit: I see the DSN is set up here as well, can that replace the wizard configuration?)

Cheers,
Yannick

dsn not assignable in Ionic after update

I am getting the following error after removing Sentry and adding it back to my Ionic Project in order to use the syntax in the updated docs.

Argument of type '{ dsn: string; }' is not assignable to parameter of type 'CordovaOptions'

The error is displaying in the create function in my editor and when I try to serve or build it just errors out.

import * as Sentry from 'sentry-cordova';
Sentry.create({ dsn: '--dsn--' });

screen shot 2018-03-29 at 9 44 17 pm

Disable Sentry

Other plugins give you the ability to disable sentry by passing in a falsey value as your DSN. I tried it here but it's saying invalid DSN.

Is there a way to "disable" error catching?

[Request] Env flag to disable sentry wizard

We're using a monorepo structure with all of our dependencies hoisted to the root, and a custom script to manage our cordova process. When the before_plugin_install_uninstall.js script runs for our ios apps, it runs sentry-wizard which calls xcode.project(...). This will fail when it tries to fork it's parseJob script because of the hoisting.

Would it be possible to add an env variable flag to skip the sentry-wizard script like there is for SENTRY_SKIP_AUTO_RELEASE?

Thank you!


fwiw, here's the error we get:

module.js:538
    throw err;
    ^

Error: Cannot find module '/Users/jskrzypek/dev/monorepo-project/packages/ionic-app/node_modules/xcode/lib/parseJob.js'
    at Function.Module._resolveFilename (module.js:536:15)
    at Function.Module._load (module.js:466:25)
    at Function.Module.runMain (module.js:676:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3

The xcode lib is installed but at ~/dev/monorepo-project/node_modules/xcode not ~/dev/monorepo-project/packages/ionic-app/node_modules/xcode

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.