newrelic / newrelic-capacitor-plugin

Mobile instrumentation plugin for the Capacitor hybrid mobile platform by Ionic
Apache License 2.0
7 stars 10 forks source link

error on web #25

Closed 24jr closed 1 year ago

24jr commented 1 year ago

I mainly need the apps for this so its not ruining my app but if im on web devloping i get infinite error

Screen Shot 2023-03-15 at 11 42 05 AM

I have import { NewRelicCapacitorPlugin } from '@newrelic/newrelic-capacitor-plugin'; imported on page but only used inside of if(platform !== 'web'){... to be clear

ndesai-newrelic commented 1 year ago

the plugin is not supported for web, you should use newrelic browser agent for web.

24jr commented 1 year ago

@ndesai-newrelic I dont want anything for web just for this error not to show up. I only use web for developing and some admin stuff so dont need analytics. I dont want any New Relic stuff called while in web but the import alone causes this I believe even if func only called while in app

ndesai-newrelic commented 1 year ago

@24jr you can use this method Capacitor.getPlatform(); and start agent when platform is ios or android.

baluworks commented 1 year ago

@ndesai-newrelic I have tried this also. but still not working. getting same error mentioned above.

24jr commented 1 year ago

Ya i am using for Capacitor.getPlatform(); if not web btw

baluworks commented 1 year ago

@24jr .with this Capacitor.getplatform() are you able to run in web? can you pl provide more details where are you using this Capacitor.getPlatform()

kennyt276 commented 1 year ago

@24jr @baluworks We've pushed out a new release with non-functional implementations for web, which should fix the issue. Feel free to re-open this issue if you run into any more problems or questions.