T
TanStack7mo ago
absent-sapphire

You are calling ReactDOMClient.createRoot() ...

Hello, i have a simple setup. Basically i have /login, /admin and / paths When i start the navigation on / nothing happens, but as soon as i go back to "/" from any other page i get this error and it is driving me mad.
main.tsx:44 You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it.
main.tsx:44 You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it.
copy of my repo: https://github.com/mrxelnag/help-needed Has anyone ever encountered something like so? Sorry if this is a stupid question or a mistake, this is my first TanstackRouter project.
GitHub
GitHub - mrxelnag/help-needed
Contribute to mrxelnag/help-needed development by creating an account on GitHub.
4 Replies
absent-sapphire
absent-sapphireOP7mo ago
I feel like that might be some caching issue or something? Because 3x dev restarts did not work, but the 4th dev restar somehow helped? I will keep it here if the issue returns during the day, otherwise i will close it . I am sorry
optimistic-gold
optimistic-gold7mo ago
It's possible that since you have a circular dep with main.tsx and App.tsx that your hot reload is breaking things. Try moving the createRouter stuff into your App.tsx
optimistic-gold
optimistic-gold7mo ago
GitHub
nv-rental-clone/src/main.tsx at master · SeanCassiere/nv-rental-clone
Navotar with Tailwind and Tanstack Router and Query - SeanCassiere/nv-rental-clone
GitHub
nv-rental-clone/src/entry-app.tsx at master · SeanCassiere/nv-renta...
Navotar with Tailwind and Tanstack Router and Query - SeanCassiere/nv-rental-clone
absent-sapphire
absent-sapphireOP7mo ago
This happend agian, i will give this a try! Thanks

Did you find this page helpful?