T
TanStack•13mo ago
genetic-orange

Debug response with line number?

Hey, this might be super stupid question. My IDE doesn't report any TS errors but when running i get e.g.
Warning: Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.
Warning: Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.
or
Uncaught (in promise) TypeError: Cannot read properties of null (reading 'navigate')
at @tanstack_react-router.js?v=5ef9859c:3293:21
Uncaught (in promise) TypeError: Cannot read properties of null (reading 'navigate')
at @tanstack_react-router.js?v=5ef9859c:3293:21
Would i need the dev tool enabled to be able to see what line and file my error is in?
3 Replies
other-emerald
other-emerald•13mo ago
dev tools won't help you here. the first issue looks like you do this in route definition
component: ()=>Foo
component: ()=>Foo
but it should be
component: Foo
component: Foo
second one might be caused by trying to access router outside of RouterProvider however you should provide a minimal complete example so we can actually help you
genetic-orange
genetic-orangeOP•13mo ago
ya, i'm aware of that now. but there are no way to see the actual file & line number where i have problems on? 🙂
other-emerald
other-emerald•13mo ago
hm it might depend on the bundler settings and if source maps are correctly set.

Did you find this page helpful?