Which project does this relate to?#
Router
Describe the bug#
I'm using @tanstack/react-router@^1.57.10 with vite@^5.4.4, @vitejs/plugin-react-swc@^3.7.0 and @tanstack/router-plugin@^1.57.11. When I build my application with the flag autoCodeSplitting set to true, it does work but it also double encodes all route files.
This means that words like Usuário becames Usu\\xE1rio. Notice the double backslash, which was probably added by the router-code-splitter-plugin. I enabled the TSR_VITE_DEBUG=true when building and noticed that it already encodes the output (Usuário -> Usu\xE1rio). What probably happens is that it probably reencodes down the plugin pipeline. And if I disable code splitting it doesn't even encodes the files.
Another bug less annoying I noticed is that I couldn't export from route files. This gave me an error when building, but I solved moving the function I needed to another regular file.
Also tested with @vitejs/plugin-react, same problem.
Your Example Website or App#
I couldn't reproduce in stackblitz, sorry.
Steps to Reproduce the Bug or Issue#
- Have a project with vite and tanstack router.
- Enable autoCodeSplitting.
- Route files will be double encoded.
Expected behavior#
Auto code sppliting should not encode words: Usuário -> Usu\\xE1rio
Screenshots or Videos#
No response
Platform#
- OS: Ubuntu 24.04 (tested on two different machines)
- Browser: Any
- Version: Any
Additional context#
No response
I cannot reproduce this https://github.com/TanStack/router/commit/20b99b19661d90b86843fb33ee3420b9576d238f#diff-8e4b3d34124256cda1eb526184dae1d90e35d9bc7fc9355bab24aeda71fdac18
can you please share the full file that caused this issue?