nativescript-sentry icon indicating copy to clipboard operation
nativescript-sentry copied to clipboard

Function calls are not supported in decorators but 'SentryModule' was called.

Open goyote opened this issue 6 years ago • 10 comments

I get this error when building for prod:

ERROR in Error during template compile of 'AppModule'

Function calls are not supported in decorators but 'SentryModule' was called.

However during dev there's no problem.

My code in app.module.ts

import {SentryModule} from 'nativescript-sentry/angular';
@NgModule({
    imports: [
        SentryModule.forRoot({dsn: 'https://...'}),
    ],
})

goyote avatar Feb 11 '19 03:02 goyote

@goyote just published 1.8.1 with rc tag, can you try it out ? thanks

danielgek avatar Feb 14 '19 14:02 danielgek

I get the same error on 1.8.1 have I install the correct version

tns plugin add [email protected]

dottodot avatar Feb 14 '19 19:02 dottodot

humm ok will take a deeper look and report back

danielgek avatar Feb 14 '19 19:02 danielgek

By the way this only happens when using aot tns run ios --bundle --env.uglify --env.aot

dottodot avatar Feb 14 '19 19:02 dottodot

Hi @dottodot and @goyote i think it's fixed, can you check with tns plugin add [email protected] ?

danielgek avatar Mar 13 '19 16:03 danielgek

OK so aot is working now but I get error when using Sentry.captureException(error) that's regardless of aot or not

null is not an object (evaluating 'SentryClient.sharedClient.sendEventWithCompletionHandler')

dottodot avatar Mar 14 '19 13:03 dottodot

Strange i got no errors while i was testing, will do more tests to see if i can sort it out, thanks ;)

danielgek avatar Mar 14 '19 14:03 danielgek

Hi @dottodot i can't reproduce it, can you send a longer stacktrace or a test case?

danielgek avatar Mar 15 '19 11:03 danielgek

OK I've found the cause of the issue. It was because I'd add my own custom error handler not realising you'd already done that. So for some reason doing that causes the error.

dottodot avatar Mar 16 '19 10:03 dottodot

it shouldn't do that, humm will investigate further, thanks ;) will release this in the coming days ;)

danielgek avatar Mar 16 '19 12:03 danielgek