Skip to content

fix: replace backslashes in full paths when generating route nodes #4430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 14, 2025

Conversation

yjoer
Copy link
Contributor

@yjoer yjoer commented Jun 14, 2025

Fixes #4428

path.posix.join is not sufficient when the first argument is a path containing backslashes, for instance, joining D:\\path with filename results in D:\\path/filename.

start-basic
Before:

.tanstack/start/build/client-dist/.vite/manifest.json        0.38 kB │ gzip:  0.20 kB
.tanstack/start/build/client-dist/assets/app-DACsPwZv.css    7.33 kB │ gzip:  2.10 kB
.tanstack/start/build/client-dist/assets/main-C896_Nb9.js  283.11 kB │ gzip: 90.49 kB

After:

.tanstack/start/build/client-dist/.vite/manifest.json                       6.80 kB │ gzip:  0.85 kB
.tanstack/start/build/client-dist/assets/app-DACsPwZv.css                   7.33 kB │ gzip:  2.10 kB
.tanstack/start/build/client-dist/assets/posts._postId-zPBcgaYs.js          0.11 kB │ gzip:  0.12 kB
.tanstack/start/build/client-dist/assets/posts_._postId.deep-EeRi2084.js    0.11 kB │ gzip:  0.12 kB
.tanstack/start/build/client-dist/assets/PostError-DDivhtBO.js              0.11 kB │ gzip:  0.11 kB
.tanstack/start/build/client-dist/assets/route-b-JZ50lMR2.js                0.12 kB │ gzip:  0.14 kB
.tanstack/start/build/client-dist/assets/route-a-BR6e2HVr.js                0.12 kB │ gzip:  0.14 kB
.tanstack/start/build/client-dist/assets/users._userId-BlXFTeC_.js          0.13 kB │ gzip:  0.14 kB
.tanstack/start/build/client-dist/assets/posts._postId-TIIP_wcq.js          0.13 kB │ gzip:  0.14 kB
.tanstack/start/build/client-dist/assets/posts.index-jechJlPM.js            0.13 kB │ gzip:  0.14 kB
.tanstack/start/build/client-dist/assets/users._userId-CuFCnY0m.js          0.13 kB │ gzip:  0.13 kB
.tanstack/start/build/client-dist/assets/index-CUl_qRyG.js                  0.17 kB │ gzip:  0.16 kB
.tanstack/start/build/client-dist/assets/_pathlessLayout-BmL-VOG7.js        0.24 kB │ gzip:  0.19 kB
.tanstack/start/build/client-dist/assets/users.index-FELXzoue.js            0.25 kB │ gzip:  0.22 kB
.tanstack/start/build/client-dist/assets/posts_._postId.deep-XaANUuD8.js    0.41 kB │ gzip:  0.29 kB
.tanstack/start/build/client-dist/assets/users._userId-KCL7sOWj.js          0.44 kB │ gzip:  0.28 kB
.tanstack/start/build/client-dist/assets/_nested-layout-CVK6kKP9.js         0.44 kB │ gzip:  0.25 kB
.tanstack/start/build/client-dist/assets/posts._postId-BKotR883.js          0.49 kB │ gzip:  0.32 kB
.tanstack/start/build/client-dist/assets/users-D3dFUtdi.js                  0.60 kB │ gzip:  0.39 kB
.tanstack/start/build/client-dist/assets/posts-cTz7c0d1.js                  0.60 kB │ gzip:  0.39 kB
.tanstack/start/build/client-dist/assets/deferred-UX5XHwZ1.js               0.82 kB │ gzip:  0.39 kB
.tanstack/start/build/client-dist/assets/main-BPKm1-5B.js                 281.86 kB │ gzip: 90.63 kB

basic-virtual-file-based
Before:

dist/index.html                   0.39 kB │ gzip:  0.27 kB
dist/assets/index-CQTDupZg.css    6.10 kB │ gzip:  1.80 kB
dist/assets/index-DO5uNxpI.js   264.38 kB │ gzip: 84.32 kB

After:

dist/index.html                          0.39 kB │ gzip:  0.26 kB
dist/assets/index-CQTDupZg.css           6.10 kB │ gzip:  1.80 kB
dist/assets/index-CXBrw_JR.js            0.12 kB │ gzip:  0.13 kB
dist/assets/world-D9fNVQmH.js            0.13 kB │ gzip:  0.14 kB
dist/assets/b-C99UymLD.js                0.13 kB │ gzip:  0.14 kB
dist/assets/a-7m4UKESZ.js                0.13 kB │ gzip:  0.14 kB
dist/assets/posts-home-gDtMaVGa.js       0.13 kB │ gzip:  0.14 kB
dist/assets/universe-4ZnthVNa.js         0.13 kB │ gzip:  0.14 kB
dist/assets/posts-detail-Lnq84mbu.js     0.16 kB │ gzip:  0.14 kB
dist/assets/home-DDjv6BaC.js             0.17 kB │ gzip:  0.16 kB
dist/assets/posts-detail-CagXeWfG.js     0.20 kB │ gzip:  0.17 kB
dist/assets/first-layout-BQq53G4l.js     0.24 kB │ gzip:  0.19 kB
dist/assets/posts-detail-DLYR3d4T.js     0.37 kB │ gzip:  0.26 kB
dist/assets/route-DXjJZLwn.js            0.38 kB │ gzip:  0.23 kB
dist/assets/second-layout-DypPv_V3.js    0.48 kB │ gzip:  0.26 kB
dist/assets/posts-H1io-iFu.js            0.60 kB │ gzip:  0.39 kB
dist/assets/index-Bc0nKp7X.js          265.41 kB │ gzip: 85.11 kB

Copy link

nx-cloud bot commented Jun 14, 2025

View your CI Pipeline Execution ↗ for commit 082dcaf.

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 6m 28s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 47s View ↗

☁️ Nx Cloud last updated this comment at 2025-06-14 17:07:54 UTC

Copy link

pkg-pr-new bot commented Jun 14, 2025

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@4430

@tanstack/directive-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/directive-functions-plugin@4430

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/eslint-plugin-router@4430

@tanstack/history

npm i https://pkg.pr.new/TanStack/router/@tanstack/history@4430

@tanstack/react-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router@4430

@tanstack/react-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-devtools@4430

@tanstack/react-router-with-query

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-with-query@4430

@tanstack/react-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@4430

@tanstack/react-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@4430

@tanstack/react-start-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-plugin@4430

@tanstack/react-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@4430

@tanstack/router-cli

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-cli@4430

@tanstack/router-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-core@4430

@tanstack/router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools@4430

@tanstack/router-devtools-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools-core@4430

@tanstack/router-generator

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-generator@4430

@tanstack/router-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-plugin@4430

@tanstack/router-utils

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-utils@4430

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-vite-plugin@4430

@tanstack/server-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/server-functions-plugin@4430

@tanstack/solid-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router@4430

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-devtools@4430

@tanstack/solid-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@4430

@tanstack/solid-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@4430

@tanstack/solid-start-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-plugin@4430

@tanstack/solid-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@4430

@tanstack/start-client-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@4430

@tanstack/start-plugin-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@4430

@tanstack/start-server-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@4430

@tanstack/start-server-functions-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-functions-client@4430

@tanstack/start-server-functions-fetcher

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-functions-fetcher@4430

@tanstack/start-server-functions-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-functions-server@4430

@tanstack/valibot-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@4430

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@4430

@tanstack/zod-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@4430

commit: 082dcaf

@schiller-manuel
Copy link
Contributor

thanks a lot!

@schiller-manuel schiller-manuel merged commit d83b6f2 into TanStack:main Jun 14, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

File based auto code splitting not working with vite on Windows
2 participants