Repository navigation
[web] app crashes after hitting url directly in browser #50639
Description
Activity
- changed the title
[-][web] app crash after hitting url directly in browser[/-][+][web] app crashes after hitting url directly in browser[/+]on Feb 12, 2020 - addedf: routesNavigator, Router, and related APIs.Navigator, Router, and related APIs.platform-webWeb applications specificallyWeb applications specifically
on Feb 12, 2020 I think it's because the framework expects a slash in your route name, e.g. "/product", but in your
routesconfiguration you don't includes slashes. Having said that, perhaps we should handle this better, so I'll schedule this for a review in the near term.Reacted by Nikhil Pawar/cc @mdebbar
@yjbanov with route name "/product", it works.Page reload takes more time to load compared to routing.
@imnikhilp I'm planning to look into this today. There are 2 areas that might be causing this issue:
- The web engine prepends "/" to the path in some cases.
- The flutter Navigator slices the initial route name using slashes, and I need to check if that logic works or not when there's no leading slash.
I am getting this error except I do have a slash in front of my route name.
routes: { "/": (context) => HomePage(), "/teams": (context) => HomePage(), },This error occurs when the web browser is refreshed when on the /teams page. Adding routes for "teams" and "//teams" doesn't help.
Could not navigate to initial route. The requested route name was: "/teams" There was no corresponding route in the app, and therefore the initial route specified will be ignored and "/" will be used instead.@mdebbar Were you able to find the problem? Let me know how I can help.
Any updates.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.- locked and limited conversation to collaborators
on Apr 25, 2020
Steps to Reproduce
** Code **