Skip to content

Intermediate Routes Without Components Fail Silently #2908

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

Closed
deckar01-bot opened this issue Aug 25, 2019 · 1 comment
Closed

Intermediate Routes Without Components Fail Silently #2908

deckar01-bot opened this issue Aug 25, 2019 · 1 comment

Comments

@deckar01-bot
Copy link

deckar01-bot commented Aug 25, 2019

Version

3.1.2

Reproduction link

https://jsfiddle.net/83t0qfhk/1/

Steps to reproduce

  1. Click the "foo" link

What is expected?

I expected the nested route's component to be rendered. When that expectation failed I opened the developer console and expected an error or a warning.

What is actually happening?

The parent has no component so nothing renders in the router view, which terminates rendering before the child component can be rendered. The router-view does not produce a console error or warning when it has been included in the template even though it has not been provided a component to render by the router.


This issue has a lot of overlap with #2105, but this issue is focused on the developer experience rather than adding functionality to support the desired syntax. There are reasonable workarounds proposed in #2105, but they don't address the fact that developers who fall into this pattern have to spend time and effort debugging this undefined behavior due to the lack of feedback from the library. This deviates from the expectations established by the useful console warnings provided when using named routes incorrectly.

Some solutions to this problem that were not explored in #2105 include:

  • Warning about router views with no component in the console
  • Adding more explicit requirements to the documentation. All router views must specify a component containing a router view to propagate rendering to child route components
@posva
Copy link
Member

posva commented Aug 25, 2019

Duplicate of #2038

Redirect routes should not have a component option BTW

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