Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VRouterScopeNotFoundException(widgetType: context.widget.runtimeType) #198

Open
lenarcikarek opened this issue Jul 13, 2022 · 3 comments
Open

Comments

@lenarcikarek
Copy link

lenarcikarek commented Jul 13, 2022

Hi!
While running debugging my app, the error bolded below appears. Please, tell me what to do to fix it, because I can't find any solution. Thanks in advance :)

VRouterScopeNotFoundException(widgetType: context.widget.runtimeType)

`static VRouterScopeData of(BuildContext context) {
VRouterScopeData? vRouterScope =
context.dependOnInheritedWidgetOfExactType();

if (vRouterScope == null) {
  throw VRouterScopeNotFoundException(
      widgetType: context.widget.runtimeType);
}

return vRouterScope;

}`

@lulupointu
Copy link
Owner

This might be because you try to call context.vRouter.to in a context higher than VRouter. I would need to see more code to understand this precise issue

@lenarcikarek
Copy link
Author

There is Vrouter in the Widget tree and it's visible in the context parent, take a look at the screenshot below. Also it has been triggered from VRouter.ScopeState.build method.
Zrzut ekranu 2022-07-15 o 08 49 32

@lulupointu
Copy link
Owner

The exception you have is expected. As you can see it is catched in the catch clause and therefore should not be an issue for your app. I think the reason why your app stop showing you this is because you set your debugger to catch any error, even those which are caught. To prevent this, uncheck "All Exceptions" in the "breakpoints" section of vscode:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants