newrelic / newrelic-flutter-agent

New Relic agent SDK for Flutter hybrid mobile apps
Apache License 2.0
7 stars 12 forks source link

Possible to no-op for web? #95

Open duraz0rz opened 3 weeks ago

duraz0rz commented 3 weeks ago

Hi, we have a Flutter app for Android, iOS, and web. We've implemented the browser agent following the directions on this page, but the actual plugin keeps throwing the following exception in the debug console running locally:

══╡ EXCEPTION CAUGHT BY FLUTTER FRAMEWORK ╞═════════════════════════════════════════════════════════
The following MissingPluginException was thrown:
MissingPluginException(No implementation found for method recordBreadcrumb on channel
newrelic_mobile)

When the exception was thrown, this was the stack:
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 297:3  throw_
packages/flutter/src/services/platform_channel.dart 332:7                    _invokeMethod
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50           <fn>
dart-sdk/lib/async/zone.dart 1407:47                                         _rootRunUnary
dart-sdk/lib/async/zone.dart 1308:19                                         runUnary
dart-sdk/lib/async/future_impl.dart 162:18                                   handleValue
dart-sdk/lib/async/future_impl.dart 838:44                                   handleValueCallback
dart-sdk/lib/async/future_impl.dart 867:13                                   _propagateToListeners
dart-sdk/lib/async/future_impl.dart 643:5                                    [_completeWithValue]
dart-sdk/lib/async/future_impl.dart 713:7                                    <fn>
dart-sdk/lib/async/zone.dart 1399:13                                         _rootRun
dart-sdk/lib/async/zone.dart 1301:19                                         run
dart-sdk/lib/async/zone.dart 1209:7                                          runGuarded
dart-sdk/lib/async/zone.dart 1249:23                                         callback
dart-sdk/lib/async/schedule_microtask.dart 40:11                             _microtaskLoop
dart-sdk/lib/async/schedule_microtask.dart 49:5                              _startMicrotaskLoop
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 181:7           <fn>
newrelic-config-dev.js 5:18269                                               nrWrapper
════════════════════════════════════════════════════════════════════════════════════════════════════

Is it possible to no-op or not load the package when it's on web?

Thanks!

ndesai-newrelic commented 3 weeks ago

@duraz0rz we will fix this in our next quarter.