Open DamienMrtl opened 1 year ago
Windows Version (the doctor check crashed) X Due to an error, the doctor check did not complete. If the error message below is not helpful, please let us know about this issue at https://github.com/flutter/flutter/issues. X ProcessException: Failed to find "systeminfo" in the search path. Command: systeminfo
Windows Version (the doctor check crashed) X Due to an error, the doctor check did not complete. If the error message below is not helpful, please let us know about this issue at https://github.com/flutter/flutter/issues. X ProcessException: Failed to find "systeminfo" in the search path. Command: systeminfo
The doctor issue is not relevant in this case. I'm using flutter web.
Thanks for the detailed report. Seeing the same exception upon running the provided code sample. It may not be specific to web, as I noticed the exception while running on mobile.
Latest breaking changes: https://pub.dev/packages/go_router/changelog#700
same issue here, any updates ?
@danielmessi13 Looks like this isn't happening anytime soon since the testing framework go_router is using can't test the RouteBuilderException, some part of either the framework or flutter catches the error before the router, I think.
Anyway the workaround mentioned by chuntai is
•••
I'm throwing custom exceptions depending on specific events that can occur during the build of the route
I think the best bet is to do a context.go when the condition is met. probably in a postframecallback. or just build a different widget base on that.
Using Flutter 3.10.0 and go_router 7.0.1
Steps to reproduce
Expected results
Expected to call ErrorBuilder when an error occurs.
This was working with go_router v3.1.1
The change was made here in this commit.
Actual results
Error gets passed up in main.dart
Code sample
Code sample
```dart import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { MyApp({super.key}); final GoRouter router = GoRouter( routes: [ GoRoute( path: '/', pageBuilder: (context, state) { throw const CustomRoutingError(); }, ), ], errorPageBuilder: (context, state) { if (state.error is CustomRoutingError) { return const MaterialPageFlutter Doctor output
Doctor output
```console [√] Flutter (Channel stable, 3.10.0, on Microsoft Windows [Version 10.0.22621.1702], locale en-CH) • Flutter version 3.10.0 on channel stable at C:\src\flutter_2 • Upstream repository https://github.com/flutter/flutter.git • Framework revision 84a1e904f4 (4 days ago), 2023-05-09 07:41:44 -0700 • Engine revision d44b5a94c9 • Dart version 3.0.0 • DevTools version 2.23.1 [√] Windows Version (Installed version of Windows is version 10 or higher) [√] Android toolchain - develop for Android devices (Android SDK version 32.0.0) • Android SDK at C:\Users\morat\AppData\Local\Android\sdk • Platform android-33, build-tools 32.0.0 • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189) • All Android licenses accepted. [√] Chrome - develop for the web • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe [!] Visual Studio - develop for Windows (Visual Studio Build Tools 2017 15.9.38) • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools • Visual Studio Build Tools 2017 version 15.9.28307.1622 • Windows 10 SDK version 10.0.17763.0 X Visual Studio 2019 or later is required. Download at https://visualstudio.microsoft.com/downloads/. Please install the "Desktop development with C++" workload, including all of its default components [√] Android Studio (version 2020.3) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin can be installed from: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189) [√] VS Code, 64-bit edition (version 1.78.2) • VS Code at C:\Program Files\Microsoft VS Code • Flutter extension version 3.64.0 [√] Connected device (3 available) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22621.1702] • Chrome (web) • chrome • web-javascript • Google Chrome 113.0.5672.93 • Edge (web) • edge • web-javascript • Microsoft Edge 112.0.1722.68 [√] Network resources • All expected network resources are available. ! Doctor found issues in 1 category. ```