T
TanStack10mo ago
wise-white

`beforeLoad` not called for pathless route

Hi, I have a pathless route called _authenticated.tsx with a beforeLoad function but it's never called. Is this by design or may it be a bug? Child routes' beforeLoad of this pathless route is called, so I'm sure I'm not throwing something in the pathless parent beforeLoad.
5 Replies
genetic-orange
genetic-orange10mo ago
can you show your file structure?
wise-white
wise-whiteOP10mo ago
No description
wise-white
wise-whiteOP10mo ago
This is my URL: https://127.0.0.1:5173/dashboard/asd First _root.tsx beforeLoad is called, then I would expect the _authenticated.tsx beforeLoad to be called, but for me, the beforeLoad from _authenticated.dashboard.$teamSlug.tsx is called. Hmm, it doesn't seem like _authenticated.tsx is called for that url...
extended-salmon
extended-salmon10mo ago
please create a minimal complete example by forking one of the existing examples on stackblitz
wise-white
wise-whiteOP10mo ago
ohh it was a user error 🤦‍♂️

Did you find this page helpful?