csells / go_router

The purpose of the go_router for Flutter is to use declarative routes to reduce complexity, regardless of the platform you're targeting (mobile, web, desktop), handling deep linking from Android, iOS and the web while still allowing an easy-to-use developer experience.
https://gorouter.dev
442 stars 96 forks source link

Exception in example #117

Closed anton-antohin-cr closed 2 years ago

anton-antohin-cr commented 2 years ago

Found an exception in example.

Is it possible to fix it? For new users to have a good first impression

Steps for reproduce

Exceptions details

```dart ======== Exception caught by widgets library ======================================================= The following assertion was thrown building InheritedGoRouter(goRouter: Instance of 'GoRouter'): Assertion failed: file:///Users/anton/development/flutter/packages/flutter/lib/src/widgets/navigator.dart:3818:14 !pageKeyToOldEntry.containsKey(page.key) is not true The relevant error-causing widget was: InheritedGoRouter InheritedGoRouter:file:///Users/anton/StudioProjects/go_router/lib/src/go_router.dart:95:41 When the exception was thrown, this was the stack: dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 251:49 throw_ dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 29:3 assertFailed packages/flutter/src/widgets/navigator.dart 3818:49 [_updatePages] packages/flutter/src/widgets/navigator.dart 3621:7 didUpdateWidget packages/flutter/src/widgets/framework.dart 4855:57 update packages/flutter/src/widgets/framework.dart 3412:14 updateChild packages/flutter/src/widgets/framework.dart 4690:16 performRebuild packages/flutter/src/widgets/framework.dart 4355:5 rebuild packages/flutter/src/widgets/framework.dart 5020:5 update packages/flutter/src/widgets/framework.dart 3412:14 updateChild packages/flutter/src/widgets/framework.dart 4690:16 performRebuild packages/flutter/src/widgets/framework.dart 4355:5 rebuild packages/flutter/src/widgets/framework.dart 4746:5 update packages/flutter/src/widgets/framework.dart 3412:14 updateChild packages/flutter/src/widgets/framework.dart 4690:16 performRebuild packages/flutter/src/widgets/framework.dart 4355:5 rebuild packages/flutter/src/widgets/framework.dart 5020:5 update packages/flutter/src/widgets/framework.dart 3412:14 updateChild packages/flutter/src/widgets/framework.dart 4690:16 performRebuild packages/flutter/src/widgets/framework.dart 4355:5 rebuild packages/flutter/src/widgets/framework.dart 5020:5 update packages/flutter/src/widgets/framework.dart 3412:14 updateChild packages/flutter/src/widgets/framework.dart 4690:16 performRebuild packages/flutter/src/widgets/framework.dart 4840:11 performRebuild packages/flutter/src/widgets/framework.dart 4355:5 rebuild packages/flutter/src/widgets/framework.dart 2620:31 buildScope packages/flutter/src/widgets/binding.dart 882:9 drawFrame packages/flutter/src/rendering/binding.dart 319:5 [_handlePersistentFrameCallback] packages/flutter/src/scheduler/binding.dart 1143:15 [_invokeFrameCallback] packages/flutter/src/scheduler/binding.dart 1080:9 handleDrawFrame packages/flutter/src/scheduler/binding.dart 996:5 [_handleDrawFrame] lib/_engine/engine/platform_dispatcher.dart 1003:13 invoke lib/_engine/engine/platform_dispatcher.dart 157:5 invokeOnDrawFrame lib/_engine/engine.dart 440:45 ==================================================================================================== Error: Assertion failed: file:///Users/anton/development/flutter/packages/flutter/lib/src/widgets/navigator.dart:3955:12 _debugLocked && !_debugUpdatingPage is not true at Object.throw_ [as throw] (http://localhost:55338/dart_sdk.js:5061:11) at Object.assertFailed (http://localhost:55338/dart_sdk.js:4986:15) at navigator$.NavigatorState.new.[_flushHistoryUpdates] (http://localhost:55338/packages/flutter/src/widgets/widget_inspector.dart.lib.js:18139:74) at http://localhost:55338/packages/flutter/src/widgets/widget_inspector.dart.lib.js:17329:47 at thunk (http://localhost:55338/packages/flutter/src/scheduler/ticker.dart.lib.js:287:9) at _RootZone.runUnary (http://localhost:55338/dart_sdk.js:38511:59) at _FutureListener.then.handleValue (http://localhost:55338/dart_sdk.js:33713:29) at handleValueCallback (http://localhost:55338/dart_sdk.js:34265:49) at Function._propagateToListeners (http://localhost:55338/dart_sdk.js:34303:17) at _Future.new.[_completeWithValue] (http://localhost:55338/dart_sdk.js:34151:23) at async._AsyncCallbackEntry.new.callback (http://localhost:55338/dart_sdk.js:34172:35) at Object._microtaskLoop (http://localhost:55338/dart_sdk.js:38778:13) at _startMicrotaskLoop (http://localhost:55338/dart_sdk.js:38784:13) at http://localhost:55338/dart_sdk.js:34519:9 ```

Thanks

csells commented 2 years ago

yeah. that's a known problem with all of the navigation techniques on Flutter web in my experience. I don't think it comes up in practice, since I don't think that users bash on the Back button as you're describing.