Skip to content

Ionic 2 (Angular2) and raven-js (undefined is not an object (evaluating 'raven_js_1.default.config')) #643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
galuszkak opened this issue Jul 7, 2016 · 5 comments

Comments

@galuszkak
Copy link

Hello, thanks for hard work on Sentry :).

Problem that I encounter is maybe related to our build configuration. We are using Ionic 2 which uses Browserify to build app.

import Raven from 'raven-js';

Raven.config('https://[email protected]/86010').install();

This code to transpiles to:

var raven_js_1 = require('raven-js');
raven_js_1.default.config('https://[email protected]/86010').install();

This produces error:

TypeError: undefined is not an object (evaluating 'raven_js_1.default.config')
(anonymous function) — app.ts:16
s — _prelude.js:1
e — _prelude.js:1
global code — _prelude.js:1

Browser is Safari/UIWebView (I believe this is used by Apache Cordova on iOS). For now because of that we can't use Sentry on our app.

Thanks for any help.

@benvinegar
Copy link
Contributor

benvinegar commented Jul 7, 2016

Hey @galuszkak – Raven.js uses Browserify itself to build it's distributables (e.g. CDN builds), so I'm guessing there's something happening here besides "doesn't work with Browserify".

@galuszkak
Copy link
Author

Just for help this is minimal not working example:
https://github.com/galuszkak/ravenjs-bug

@davorpeic
Copy link

Hey @galuszkak did you tried to update your ionic2 to RC1? Can't get raven-js to work with my ionic2 app, angular2 documentation is useless as it seems that ravenjs is not working with aot :(

@filipsuk
Copy link

@davorpeic did you manage to get it working with new Ionic2? Thanks

@davorpeic
Copy link

@filipsuk Hi, yes, I wrote my tips here #735 and now is working fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants