Generated tree file isnt being built with Vite
Im running into this issue where the route tree cant be build with Vite and Rollup. Have anyone else run into this issue?
From the output it seems like the file isnt being compiled to js
25 Replies
rival-black•15mo ago
That'd weird.
Maybe you just need to regen the route-tree. Like turn on the dev-server once?
deep-jadeOP•15mo ago
I deleted the route-tree but it's still happening
rival-black•15mo ago
Could you try moving the react-refresh plugin below the TanStack Router plugin and try?
Is this project on GitHub? where I can see the source?
deep-jadeOP•15mo ago
sorry it's closed source
the dev server isnt having any problem
but the build step is erroring
rival-black•15mo ago
What does your build script look like?
deep-jadeOP•15mo ago
it's just a standard vite build
I can try deleting node_module and rebuild
rival-black•15mo ago
Can you try this?
deep-jadeOP•15mo ago
still no
rival-black•15mo ago
Can you share your package.json and routeTree.gen.ts files
deep-jadeOP•15mo ago
deep-jadeOP•15mo ago
rival-black•15mo ago
I'm honestly kind of stumped... Everything looks to be in order.
Could you compare your tsconfig against mine and see if anything stands out to you. https://github.com/SeanCassiere/nv-rental-clone
GitHub
GitHub - SeanCassiere/nv-rental-clone: Navotar with Tailwind and th...
Navotar with Tailwind and the Tanstack. Contribute to SeanCassiere/nv-rental-clone development by creating an account on GitHub.
deep-jadeOP•15mo ago
I can try using your ts config and go from there
rival-black•15mo ago
Yea, give it a shot. Did this just start happening?
deep-jadeOP•15mo ago
I noticed it when I pushed it to ci
I forgot to build the project before hand since tsc didnt return any error
basically last night
it happens on ci also so it's isnt local to my. machine at least
lemme grab the package.json and just clone the project over to a github repo to see if I can reproduce it
After I striped the project down to nothing it seems to work now?
I think it's something with the name
here's my component tree
the error persists with this tree still
I have to go out a bit, I'll continue bisecting the bug later
rival-black•15mo ago
Just to confirm this is the tree.
deep-jadeOP•15mo ago
so I managed to reproduce it with this tree
deep-jadeOP•15mo ago
this tree is ok

deep-jadeOP•15mo ago
this tree is not

deep-jadeOP•15mo ago
lemme push the reproduction onto github, sec
deep-jadeOP•15mo ago
GitHub
GitHub - ShuviSchwarze/tanstack-router-vite-build
Contribute to ShuviSchwarze/tanstack-router-vite-build development by creating an account on GitHub.
deep-jadeOP•15mo ago
This is my minimum reproducable
Update: I updated all my dependencies and it's back to building normally now
something was fixed between here and there so the problem is resolved. The version on my github is still the bugged version if anyone is interested in looking into it
rival-black•15mo ago
Thats so weird... Nothing really changed on our side, that'd break route generation. Maybe just something with vite 🤷🏼
deep-jadeOP•15mo ago
I believe it was related to either of these pr
https://github.com/vitejs/vite/pull/17472
https://github.com/vitejs/vite/pull/17479
GitHub
fix(build): handle preload treeshaking for commas by bluwy · Pull R...
Description
fix #17466
We didn't handle the case for syntax like this.
const foo = (await import('foo')).foo, bar = ...
The trailing comma was incorrectly captured by the regex. I updat...
GitHub
fix(build): handle preload treeshaking for braces by bluwy · Pull R...
Description
fix #17478
Handle the cases shown in the issue above. The third part of the regex was to lax to support import(...).then(function ({ ... }) so I tighten it up so it's not too greedy...
rival-black•15mo ago
That's weird since I didn't notice this in my personal repo... Then again maybe it had to do with how using the
.lazy
syntax worked 🤔
I've been using the experimental.enableCodeSplitting
flag, so it likely was something I didn't see.