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

Throw exception or provide info message when route's component is null #2038

Open
mortyccp opened this issue Jan 31, 2018 · 7 comments
Open

Comments

@mortyccp
Copy link

What problem does this feature solve?

Currently, route's component can be null and it give no information and error. Provide information or raising error can help users to catch they have some import issues when they use

import * as components from './components'

export default [
  {
    path: '/accounts',
    component: components.AccountsListView,
    name: 'accountsListView'
  },
  {
    path: '/accounts/create',
    component: components.CreateEditAccounts,
    name: 'createAccounts'
  }
]

So if components.CreateEditAccounts is null, they will know what went wrong easier.

What does the proposed API look like?

Raise error when component is null or log info message.

@posva
Copy link
Member

posva commented Jan 31, 2018

for anybody picking this up: make sure to check it only in dev mode

@serge1peshcoff
Copy link

I will try to implement this the next week if nobody would be faster than me

@posva
Copy link
Member

posva commented Feb 8, 2018

There's already a pr 😉

@posva posva added the has PR label Mar 26, 2019
@posva
Copy link
Member

posva commented Mar 26, 2019

Note to myself, this could be solved through typings

@deckar01
Copy link

This issue also produces unexpected behavior when routes without components have child routes. See #2908.

@posva The MR for this is 18 months old. Can we close that and remove the has PR label?

@posva posva removed the has PR label May 26, 2020
@amitkeinan9
Copy link

I see that no one had touched this issue since March. May I try?

@Robert-Kovalcuk
Copy link

is it still possible to solve the issue?

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

No branches or pull requests

6 participants