Uncaught Promise (null)
On my production deployment I'm seeing an uncaught error due to null -
Struggling to find where this might be coming from - looking at the source in the browser it's pointing to my index.html (dashboard:1). Any suggestions on things to look at that I might've misconfigured?

12 Replies
fair-roseOP•5mo ago
Here is my main.tsx:
eastern-cyan•5mo ago
The issue is not in the code you've shown here. Maybe you could provide a minimal reproduction?
fair-roseOP•5mo ago
Yeah, struggling to reproduce it myself, only happens on prod.
Claude suggested it might be routes itself returning nulls before they're fully ready to render
rival-black•5mo ago
if it's only on prod then it's most likely the deployment that's the issue
fair-roseOP•5mo ago
Yeah - very well could be, it's deployed up on vercel currently, might try deploying elsewhere to see if it crops up.
Where all do you generally deploy your tanstack router apps?
robust-apricot•5mo ago
does it only happen on deployed version or also locally when running a prod build?
fair-roseOP•5mo ago
ooh, great shout - will check soon, about to jump into a few meetings
ooh, happening local with prod build too
fair-roseOP•5mo ago

robust-apricot•5mo ago
maybe something with initialization order. have you codesplitting enabled? if yes try disabling g
fair-roseOP•5mo ago
I do have it enabled, let me try disabling
still happens -
This is my vite config:
definitely seems something retrying over time - periodically pings the console
Any other thoughts you think I should run down? 🙂 I haven’t been able to find it yet
robust-apricot•5mo ago
not without a reproducer
fair-roseOP•5mo ago
I ripped out my routes last night and this is still happening.. so continue to dig, might be able to reproduce it here soon
hmmm, seems the example auth firebase no longer builds -
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '.../router/examples/react/authenticated-routes-firebase/node_modules/@tanstack/router-plugin/dist/esm/vite.js' imported from .../router/examples/react/authenticated-routes-firebase/node_modules/.vite-temp/vite.config.js.timestamp-1746191392395-c53b44a6fada7.mjs
I'll try to investigate wth is going on with this to see if I can reproduce it
hmmm.. okay - not happening in the sample project, time to peel the onion back 🙂
damn, just found the bit of code freaking TF out 🙂
In my firebase config.ts- not sure why it's geeking out yet, but this was it.
Literally had to rip everything out to find this needle haha