Describe the bug
pnpm test:docs fails on Windows with 27 broken links that are all fine. Every one of them is a documentation link pointing at an example.
scripts/verify-links.ts builds the target path with path.resolve, which uses the platform separator, and then matches that path against patterns written with forward slashes:
https://github.com/TanStack/query/blob/main/scripts/verify-links.ts#L56-L68
const isExample = absPath.includes('/examples/')
if (isExample) {
absPath = absPath.replace(
/\/docs\/framework\/([^/]+)\/examples\//,
'/examples/$1/',
)
exists = existsSync(absPath) && statSync(absPath).isDirectory()
}
On Windows absPath is C:\Users\...\docs\framework\react\examples\simple, so includes('/examples/') is false. The example branch never runs, the path is never rewritten to examples/react/simple, and the link is looked up as a markdown file that does not exist.
CI does not catch this because it runs on Linux.
Your minimal, reproducible example
Clone the repository on Windows and run the script directly:
pnpm install
node scripts/verify-links.ts
Steps to reproduce
- Clone the repository on Windows.
- Run
pnpm install.
- Run
node scripts/verify-links.ts (or pnpm test:docs).
Output:
Found 494 markdown files
❌ Found 27 broken links:
docs/framework/lit/quick-start.md
link: ./examples/basic
resolved: C:\Users\...\query\docs\framework\lit\examples\basic.md
why: Not found
...
The resolved path in the report shows the problem directly: it still points into docs/framework/lit/examples/ instead of examples/lit/.
Expected behavior
The check should pass on Windows just as it does on CI, so contributors can run pnpm test:docs locally before pushing. CONTRIBUTING.md points people at these commands.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
- OS: Windows 11
- Node: 24.11.1
- pnpm: 11.9.0
Tanstack Query adapter
None
TanStack Query version
current main
TypeScript version
5.9.3
Additional context
CONTRIBUTING.md does note that the repository uses symlink based configuration and recommends WSL, but this script does not need symlinks and works fine once the separators are normalized. Fix and PR coming.
Describe the bug
pnpm test:docsfails on Windows with 27 broken links that are all fine. Every one of them is a documentation link pointing at an example.scripts/verify-links.tsbuilds the target path withpath.resolve, which uses the platform separator, and then matches that path against patterns written with forward slashes:https://github.com/TanStack/query/blob/main/scripts/verify-links.ts#L56-L68
On Windows
absPathisC:\Users\...\docs\framework\react\examples\simple, soincludes('/examples/')is false. The example branch never runs, the path is never rewritten toexamples/react/simple, and the link is looked up as a markdown file that does not exist.CI does not catch this because it runs on Linux.
Your minimal, reproducible example
Clone the repository on Windows and run the script directly:
Steps to reproduce
pnpm install.node scripts/verify-links.ts(orpnpm test:docs).Output:
The resolved path in the report shows the problem directly: it still points into
docs/framework/lit/examples/instead ofexamples/lit/.Expected behavior
The check should pass on Windows just as it does on CI, so contributors can run
pnpm test:docslocally before pushing. CONTRIBUTING.md points people at these commands.How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
Tanstack Query adapter
None
TanStack Query version
current
mainTypeScript version
5.9.3
Additional context
CONTRIBUTING.md does note that the repository uses symlink based configuration and recommends WSL, but this script does not need symlinks and works fine once the separators are normalized. Fix and PR coming.