Skip to content
This repository has been archived by the owner on Nov 14, 2020. It is now read-only.

Reference error, io is not defined #32

Open
carlosen14 opened this issue Jul 2, 2019 · 1 comment
Open

Reference error, io is not defined #32

carlosen14 opened this issue Jul 2, 2019 · 1 comment

Comments

@carlosen14
Copy link

carlosen14 commented Jul 2, 2019

### If the demo apps cannot help and there is no issue for your problem, tell us about it does compile, but when run on emulator crashes showing at top `io is not defined` Error is pointing to `sentry.js`, this is corresponding to [this](https://github.com/danielgek/nativescript-sentry/blob/master/src/sentry.android.ts#L12) line on `sentry.android.ts` ### Which platform(s) does your issue occur on? - Android - 9 versions - emulator ### Please, provide the following version numbers that your issue occurs with: - CLI: 5.2.0 - Cross-platform modules: 5.2.2 - Runtime(s): "tns-android": 5.2.1 and "tns-ios": 5.2.0 - Plugin(s): ```js "dependencies": { "@angular/animations": "7.2.0", "@angular/common": "7.2.0", "@angular/compiler": "7.2.0", "@angular/core": "7.2.0", "@angular/forms": "7.2.0", "@angular/http": "7.2.0", "@angular/platform-browser": "7.2.0", "@angular/platform-browser-dynamic": "7.2.0", "@angular/router": "7.2.0", "ajv": "6.9.1", "atob": "2.1.2", "lodash": "4.17.11", "moment": "2.24.0", "nativescript-angular": "7.2.1", "nativescript-localstorage": "2.0.0", "nativescript-permissions": "1.3.6", "nativescript-sentry": "^1.9.1", "nativescript-statusbar": "5.0.0", "nativescript-theme-core": "1.0.4", "nativescript-ui-sidedrawer": "6.0.0", "reflect-metadata": "0.1.12", "rxjs": "6.3.3", "tns-core-modules": "5.2.2", "zone.js": "0.8.26" }, "devDependencies": { "@angular/compiler-cli": "7.2.0", "@nativescript/schematics": "0.5.0", "@ngtools/webpack": "7.2.0", "@types/atob": "2.1.2", "@types/lodash": "4.14.130", "@types/mocha": "5.2.6", "@types/moment": "2.13.0", "nativescript-dev-sass": "^1.7.0", "nativescript-dev-typescript": "0.8.0", "nativescript-dev-webpack": "0.20.0" } ``` ### Please, tell us how to recreate the issue in as much detail as possible. had my project working, installed this plugin following the [config](https://github.com/danielgek/nativescript-sentry#with-angular) section. also installed the plugin for the Android SLF4J Log Error [from here](https://github.com/danielgek/nativescript-sentry#android-slf4j-log-error) added this on appmodule.ts ```js import { SentryModule } from 'nativescript-sentry/angular'; @NgModule({ bootstrap: [ AppComponent ], imports: [ NativeScriptModule, AppRoutingModule, HttpClientModule, NativeScriptFormsModule, NativeScriptUISideDrawerModule, NativeScriptCommonModule, SharedModule, SentryModule.forRoot({dsn: 'https://[email protected]/5'}) ``` now, the app crashes. I didn't even added something to capture exceptions. I'm on linux ubuntu 18.04 android studio (for the emulator) 3.3.1 ### Is there any code involved? is showing this ``` I'm still facing io is not defined on Android w/ Angular Using: "nativescript-angular": "~7.2.1", "nativescript-sentry": "1.9.1" io is not defined ReferenceError: io is not defined at Function.Sentry.init (file:///data/data/org.nativescript.mobilesicdh2/files/app/tns_modules/nativescript-sentry/sentry.js:8:9) at new SentryErrorHandler (file:///data/data/org.nativescript.mobilesicdh2/files/app/tns_modules/nativescript-sentry/angular/error.handler.js:12:24) at provideSentryServiceOptions (file:///data/data/org.nativescript.mobilesicdh2/files/app/tns_modules/nativescript-sentry/angular/app.module.js:31:12) at _callFactory (file:///data/data/org.nativescript.mobilesicdh2/files/app/tns_modules/@angular/core/bundles/core.umd.js:21205:24) at _createProviderInstance (file:///data/data/org.nativescript.mobilesicdh2/files/app/tns_modules/@angular/core/bundles/core.umd.js:21161:30) at initNgModule (file:///data/data/org.nativescript.mobilesicdh2/files/app/tns_modules/@angular/core/bundles/core.umd.js:21091:36) at new NgModuleRef_ (file:///data/data/org.nativescript.mobilesicdh2/files/app/tns_modules/@angular/core/bundles/core.umd.js:21818:13) at createNgModuleRef (file:///data/data/org.nativescript.mobilesicdh2/files/app/tns_modules/@angular/core/bundles/core.umd.js:21807:16) at Object.debugCreateNgModuleRef [as createNgModuleRef] (file:///data/data/org.nativescript.mobilesicdh2/files/app/tns_modules/@angular/core/bundles/core.umd.js:23638:16) at NgModuleFactory_.create (file:///data/data/org.nativescript.mobilesicdh2/files/app/tns_modules/@angular/core/bundles/core.umd.js:24342:29) at file:///data/data/org.nativescript.mobilesicdh2/files/app/tns_modules/@angular/core/bundles/core.umd.js:17800:47 at ZoneDelegate.invoke (file:///data/data/org.nativescript.mobilesicdh2/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:388:26) at Object.onInvoke (file:///data/data/org.nativescript.mobilesicdh2/files/app/tns_modules/@angular/core/bundles/core.umd.js:17334:37) at ZoneDelegate.invoke (file:///data/data/org.nativescript.mobilesicdh2/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:387:32) at Zone.run (file:///data/data/org.nativescript.mobilesicdh2/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:138:43) ```

@carlosen14
Copy link
Author

carlosen14 commented Jul 2, 2019

I just did noticed about the comments on sentry.android.ts about the init, this configuration steps.
I think they must be on the README.md.

Checked those steps, still not working.
I have this on app.gradle

dependencies {
    // Sentry
    implementation 'io.sentry:sentry-android:1.7.21'
    implementation 'org.slf4j:slf4j-nop:1.7.25'
}

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

No branches or pull requests

1 participant