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
provincial-silver•2y ago
That'd weird.
Maybe you just need to regen the route-tree. Like turn on the dev-server once?
correct-apricotOP•2y ago
I deleted the route-tree but it's still happening
provincial-silver•2y 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?
correct-apricotOP•2y ago
sorry it's closed source
the dev server isnt having any problem
but the build step is erroring
provincial-silver•2y ago
What does your build script look like?
correct-apricotOP•2y ago
it's just a standard vite build
I can try deleting node_module and rebuild
provincial-silver•2y ago
Can you try this?
correct-apricotOP•2y ago
still no
provincial-silver•2y ago
Can you share your package.json and routeTree.gen.ts files
correct-apricotOP•2y ago
correct-apricotOP•2y ago
provincial-silver•2y 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.
correct-apricotOP•2y ago
I can try using your ts config and go from there
provincial-silver•2y ago
Yea, give it a shot. Did this just start happening?
correct-apricotOP•2y 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
provincial-silver•2y ago
Just to confirm this is the tree.
correct-apricotOP•2y ago
so I managed to reproduce it with this tree
correct-apricotOP•2y ago
this tree is ok

correct-apricotOP•2y ago
this tree is not

correct-apricotOP•2y ago
lemme push the reproduction onto github, sec
correct-apricotOP•2y ago
GitHub
GitHub - ShuviSchwarze/tanstack-router-vite-build
Contribute to ShuviSchwarze/tanstack-router-vite-build development by creating an account on GitHub.
correct-apricotOP•2y 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
provincial-silver•2y ago
Thats so weird... Nothing really changed on our side, that'd break route generation. Maybe just something with vite 🤷🏼
correct-apricotOP•2y 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...
provincial-silver•2y 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.