I'm trying to combine flutter web with firebase and stripe. I managed to get a sessionId from Stripe and redirect to their checkout page. After filling out this page the user gets redirected to an url, provided by me. This works fine if the user cancels the process, however fails if the payment process was successful.

The urls for cancel and success are the same.

  _redirectToStripe(String uid) async {
QueryDocumentSnapshot productDocSnap = await membershipRef
    .where('active', isEqualTo: true)
    .then((snap) => snap.docs[0]);
QueryDocumentSnapshot price = await productDocSnap.reference
    .where('active', isEqualTo: true)
    .then((snap) => snap.docs[0]);
setState(() => _priceID = price.id);
DocumentReference docRef =
    await userRef.doc(uid).collection('checkout_sessions').add({
  'price': _priceID,
  'success_url': Constants.url,
  'cancel_url': Constants.url,

docRef.snapshots().listen((event) {
  var data = event.data();
  if (data['sessionId'] != null) {
    _savePurchaseData(context, uid);
    js.context.callMethod('redirectToStripe', [event.data()['sessionId']]);

Upon redirecting back to my app, the following error occurs in the console of chrome:

Error from backend:

Error: NoSuchMethodError: The method 'shutDown' was called on null.
Receiver: null
Tried calling: shutDown()

Stack Trace:
#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
#1      DevHandler._handleConnectRequest (package:dwds/src/handlers/dev_handler.dart:383:28)
#2      DevHandler._handleConnection.<anonymous closure> (package:dwds/src/handlers/dev_handler.dart:257:21)
#3      _rootRunUnary (dart:async/zone.dart:1198:47)
#4      _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#5      _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7)
#6      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:357:11)
#7      _DelayedData.perform (dart:async/stream_impl.dart:611:14)
#8      _StreamImplEvents.handleNext (dart:async/stream_impl.dart:730:11)
#9      _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:687:7)
#10     _rootRun (dart:async/zone.dart:1182:47)
#11     _CustomZone.run (dart:async/zone.dart:1093:19)
#12     _CustomZone.runGuarded (dart:async/zone.dart:997:7)
#13     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
#14     _rootRun (dart:async/zone.dart:1190:13)
#15     _CustomZone.run (dart:async/zone.dart:1093:19)
#16     _CustomZone.runGuarded (dart:async/zone.dart:997:7)
#17     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
#18     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#19     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#20     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#21     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:169:5)

Flutter doctor:

[√] Flutter (Channel beta, 1.20.0, on Microsoft Windows [Version 10.0.17763.864], locale de-DE)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[√] Chrome - develop for the web
[!] Android Studio (version 3.6)
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
[√] VS Code (version 1.51.1)
[√] Connected device (2 available)

How do I get rid of this error?

Thanks in advance!