You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
autoCodeSplitting encodes special characters #2361
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)
The issue hasn't been fully resolved, and I've encountered the same problem. Up to now, Chinese characters are still being escaped into Unicode encoding. This issue only occurs when autoCodeSplitting is enabled.
Activity
tests: add test for #2361
schiller-manuel commentedon Sep 18, 2024
I cannot reproduce this 20b99b1#diff-8e4b3d34124256cda1eb526184dae1d90e35d9bc7fc9355bab24aeda71fdac18
can you please share the full file that caused this issue?
oMatheuss commentedon Sep 18, 2024
Ok, I could finally reproduce this error with minimal configuration on stackbluitz here.
In dev mode, everything is fine. You need to tun
npm run buildandnpm run preview.@schiller-manuel thanks for looking into it.
fix(router-plugin): do not minify code in compiler
fix(router-plugin): do not minify code in compiler (TanStack#2366)
coldsmirk commentedon Jan 16, 2025
The issue hasn't been fully resolved, and I've encountered the same problem. Up to now, Chinese characters are still being escaped into Unicode encoding. This issue only occurs when
autoCodeSplittingis enabled.