riot / route

Simple isomorphic router
MIT License
212 stars 40 forks source link

this.parent is null immediately upon load #119

Closed Asuza closed 6 years ago

Asuza commented 6 years ago

I need to get rid of this error, but I'm not sure what the cause is. The only thing that seems to make it go away is if I get rid of every single route in my <router> tag.

For example, this causes an error:

        <router>
            <route path="group/create"><thread-create /></route>
        </router>

But this does not:

        <router>
        </router>

The error is as follows:

TypeError: this.parent is null[Learn More] route+tag.min.js:1:4239
    route</< https://cdn.jsdelivr.net/npm/riot-route@3.1.3/dist/route+tag.min.js:1:4239
    vt/</< https://cdnjs.cloudflare.com/ajax/libs/riot/3.10.3/riot+compiler.min.js:2:23015
    vt/< https://cdnjs.cloudflare.com/ajax/libs/riot/3.10.3/riot+compiler.min.js:2:22541
    xt https://cdnjs.cloudflare.com/ajax/libs/riot/3.10.3/riot+compiler.min.js:2:24500
    e https://cdnjs.cloudflare.com/ajax/libs/riot/3.10.3/riot+compiler.min.js:2:15556
    me https://cdnjs.cloudflare.com/ajax/libs/riot/3.10.3/riot+compiler.min.js:2:9810
    e https://cdnjs.cloudflare.com/ajax/libs/riot/3.10.3/riot+compiler.min.js:2:15618
    Je https://cdnjs.cloudflare.com/ajax/libs/riot/3.10.3/riot+compiler.min.js:2:15498
    mount/< https://cdnjs.cloudflare.com/ajax/libs/riot/3.10.3/riot+compiler.min.js:2:36486
    i https://cdnjs.cloudflare.com/ajax/libs/riot/3.10.3/riot+compiler.min.js:2:36123
    o https://cdnjs.cloudflare.com/ajax/libs/riot/3.10.3/riot+compiler.min.js:2:36174
    Er/n.onreadystatechange https://cdnjs.cloudflare.com/ajax/libs/riot/3.10.3/riot+compiler.min.js:2:35299
Asuza commented 6 years ago

I was using riot.mount('*'); when it wasn't working. However, switching it to riot.mount('router'); seemed to solve the issue.