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

Router behaviour on empty (null) root #388

Closed
Infeligo opened this issue Dec 28, 2014 · 3 comments
Closed

Router behaviour on empty (null) root #388

Infeligo opened this issue Dec 28, 2014 · 3 comments
Labels
Type: Bug For bugs and any other unexpected breakage

Comments

@Infeligo
Copy link

When m.route is called for null root, the modules are initialized, but nothing is rendered (without any errors or warnings). I just encountered this when passing non-existent document.body and it took some time to figure out the "root" of the problem (pun intended). This problem may occur in case of a typo or if you use the element before it has been parsed (yes, a newbie's error).

So I was wondering. Is there a case when null root is desired? If no, then shouldn't Mithril warn about such faulty usage?

@lhorie
Copy link
Member

lhorie commented Dec 29, 2014

Can you post a jsfiddle showing a case where an error doesn't occur? It should throw an error in that specific case: https://github.com/lhorie/mithril.js/blob/next/mithril.js#L435

@Infeligo
Copy link
Author

Here you go: http://jsfiddle.net/svs20348/

lhorie added a commit that referenced this issue Dec 31, 2014
@lhorie
Copy link
Member

lhorie commented Dec 31, 2014

Fixed in origin/next

@lhorie lhorie closed this as completed Dec 31, 2014
@lhorie lhorie added the Type: Bug For bugs and any other unexpected breakage label Dec 31, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug For bugs and any other unexpected breakage
Projects
None yet
Development

No branches or pull requests

2 participants