T
TanStack2y ago
metropolitan-bronze

Bug or I am doing something wrong

I see the below error in console. I am not sure if this some bug or I am doing something wrong. Reproduction link: https://stackblitz.com/edit/github-mkmefb Uncaught Error: Invariant failed: Duplicate routes found with id: __root__
Murali
StackBlitz
Router Quickstart Example - StackBlitz
Run official live example code for Router Quickstart, created by Tanstack on StackBlitz
2 Replies
wee-brown
wee-brown2y ago
You likely have a bad or empty path on one of your routes If you pass a path, a non empty string is required.
metropolitan-bronze
metropolitan-bronzeOP2y ago
Thanks Looks much better after I changed path from '' to '/' . But now I have typescript errors. We can see the error by running npm run build also editor shows same error in file pages/layout.tsx Type '"/" | "/account" | "/auth/login" | "/auth/register" | "/about" | "/account/setting" | "/account/change-password"' is not assignable to type '"/" | "/account" | "/auth" | "/auth/login" | "/auth/register" | "/about"'. Type '"/account/setting"' is not assignable to type '"/" | "/account" | "/auth" | "/auth/login" | "/auth/register" | "/about"'.(2322) However /account/setting is fine when navigated from browser Anyone looking at this thread for answer see https://github.com/TanStack/router/issues/896

Did you find this page helpful?