-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Correct NextJS link URL #5488
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
Correct NextJS link URL #5488
Conversation
WalkthroughUpdated Markdown link targets in Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch! I must've missed this one.
@schiller-manuel This is good to go whenever you can merge it :)
It seems like the label ![]() |
@aaronjordan you can, absolutely. |
Got it. Thank you for the speedy feedback! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs/start/framework/react/getting-started.md
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
docs/**/*.{md,mdx}
📄 CodeRabbit inference engine (AGENTS.md)
Use internal docs links relative to the docs/ folder (e.g., ./guide/data-loading)
Files:
docs/start/framework/react/getting-started.md
docs/{router,start}/**
📄 CodeRabbit inference engine (AGENTS.md)
Place router docs under docs/router/ and start framework docs under docs/start/
Files:
docs/start/framework/react/getting-started.md
🪛 LanguageTool
docs/start/framework/react/getting-started.md
[grammar] ~10-~10: There might be a mistake here.
Context: ...or your specific framework: - Next.js - Remix 2 / React Router 7 "Framework Mode...
(QB_NEW_EN)
- [Start a new project from scratch](#start-a-new-project-from-scratch) to quickly learn how Start works (see below) | ||
- Refer to a migration guide for your specific framework: | ||
- [Next.js](../guide/migrate-from-next-js) | ||
- [Next.js](../migrate-from-next-js) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Broken relative path to Next.js migration guide
Using ../migrate-from-next-js
climbs out of the react/
directory, landing on a non-existent framework/migrate-from-next-js
page. Switch to the local ./migrate-from-next-js
path so the link resolves to framework/react/migrate-from-next-js
.
- - [Next.js](../migrate-from-next-js)
+ - [Next.js](./migrate-from-next-js)
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
- [Next.js](../migrate-from-next-js) | |
- [Next.js](./migrate-from-next-js) |
🧰 Tools
🪛 LanguageTool
[grammar] ~10-~10: There might be a mistake here.
Context: ...or your specific framework: - Next.js - Remix 2 / React Router 7 "Framework Mode...
(QB_NEW_EN)
🤖 Prompt for AI Agents
In docs/start/framework/react/getting-started.md around line 10, the link to the
Next.js migration guide uses a broken relative path "../migrate-from-next-js"
which climbs out of the react/ directory; change it to the local relative path
"./migrate-from-next-js" so the link resolves to
framework/react/migrate-from-next-js (update the Markdown link target
accordingly).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and the other link change follow the precedent in the file of links that work properly. I'm not close enough to the project to know why they're all beginning with ../
.
Would be interested to learn if there's an easy explanation 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Explore the directory structure around the getting-started.md file
echo "=== Directory structure of docs/start/framework ==="
fd . docs/start/framework --type d --max-depth 3 | sort
echo -e "\n=== Finding the migrate-from-next-js file ==="
fd migrate-from-next-js docs/start/framework
echo -e "\n=== List all markdown files in docs/start/framework/react ==="
fd . docs/start/framework/react --type f -e md | sort
echo -e "\n=== Check if there's a guide directory ==="
if [ -d "docs/start/framework/guide" ]; then
echo "guide directory exists"
fd . docs/start/framework/guide --type f -e md | sort
else
echo "No guide directory found"
fi
echo -e "\n=== List all markdown files directly under docs/start/framework ==="
fd . docs/start/framework --type f -e md --max-depth 1 | sort
Length of output: 2032
🏁 Script executed:
#!/bin/bash
# Find documentation framework configuration files
echo "=== Looking for documentation framework config files ==="
fd -e json -e js -e ts config docs/ --max-depth 3 2>/dev/null || echo "No config in docs/"
echo -e "\n=== Checking root for common doc framework configs ==="
ls -la | grep -E "(docusaurus|vitepress|nextra|vocs|astro)" || echo "No obvious framework config in root"
echo -e "\n=== Looking for package.json to identify framework ==="
if [ -f "package.json" ]; then
echo "Found package.json, checking for doc frameworks..."
cat package.json | jq -r '.dependencies, .devDependencies | to_entries[] | select(.key | contains("docs") or contains("docusaurus") or contains("vitepress") or contains("nextra") or contains("vocs") or contains("astro")) | "\(.key): \(.value)"' 2>/dev/null || echo "Using jq failed, trying grep..."
grep -E "\"(docusaurus|vitepress|nextra|vocs|astro|@tanstack)" package.json | head -20
fi
echo -e "\n=== Looking for vocs config specifically ==="
fd vocs.config -e ts -e js --max-depth 2
echo -e "\n=== Checking the docs directory structure ==="
ls -la docs/ 2>/dev/null | head -20
Length of output: 1634
🏁 Script executed:
#!/bin/bash
# Check the docs config files
echo "=== Content of docs/start/config.json ==="
cat docs/start/config.json
echo -e "\n=== Content of docs/router/config.json ==="
cat docs/router/config.json
echo -e "\n=== Checking for TanStack config ==="
fd tanstack.config -e ts -e js --max-depth 2
echo -e "\n=== Look at the URL structure in production ==="
echo "Production URL from PR: https://tanstack.com/start/latest/docs/framework/react/getting-started"
echo "File location: docs/start/framework/react/getting-started.md"
echo ""
echo "This suggests the URL pattern:"
echo "- /start/ -> maps to docs/start/"
echo "- /latest/docs/ -> seems to be injected by the framework"
echo "- /framework/react/getting-started -> matches the file path after docs/start/"
Length of output: 29100
@aaronjordan Great question! 🙂
The ../
pattern works here because TanStack uses a custom documentation framework that handles link resolution differently from standard filesystem relative paths. Looking at the docs/start/config.json
file, I can see how the routing structure is defined.
Here's what's happening:
From the file system perspective:
- Your file:
docs/start/framework/react/getting-started.md
- Links like
../quick-start
would normally resolve todocs/start/framework/quick-start.md
(which doesn't exist!)
But from the documentation framework's perspective:
- The framework uses the routing configuration in
config.json
where routes are defined as:"to": "framework/react/getting-started"
"to": "framework/react/quick-start"
"to": "framework/react/migrate-from-next-js"
How the framework resolves ../
links:
The documentation build system treats ../
as a special prefix that gets intelligently resolved against the routing structure. When you're on a page at framework/react/getting-started
and use:
../quick-start
→ resolves toframework/react/quick-start
../guide/routing
→ resolves toframework/react/guide/routing
../migrate-from-next-js
→ resolves toframework/react/migrate-from-next-js
This is why your change from ../guide/migrate-from-next-js
to ../migrate-from-next-js
is correct—it matches the actual route structure defined in the config, where the migration guide is at framework/react/migrate-from-next-js
, not framework/react/guide/migrate-from-next-js
.
The ../
prefix is essentially a convention used by the TanStack docs framework to indicate "resolve this relative to the current page's context" rather than performing literal directory traversal.
- [TanStack Start CLI](../quick-start) - Just run `npm create @tanstack/start@latest`. Local, fast, and optionally customizable | ||
- [TanStack Builder](#) (coming soon!) - A visual interface to configure new TanStack projects with a few clicks | ||
- [Quick Start Examples](../quick-start) Download or clone one of our official examples | ||
- [Build a project from scratch](../build-from-scratch) - A guide to building a TanStack Start project line-by-line, file-by-file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix quick-start and build-from-scratch link paths
All three links point to ../...
, which omits the react/
segment and breaks navigation. Keep them in the current directory with ./
so they resolve to the intended framework/react/*
pages.
-- [TanStack Start CLI](../quick-start) - Just run `npm create @tanstack/start@latest`. Local, fast, and optionally customizable
+- [TanStack Start CLI](./quick-start) - Just run `npm create @tanstack/start@latest`. Local, fast, and optionally customizable
...
-- [Quick Start Examples](../quick-start) Download or clone one of our official examples
+- [Quick Start Examples](./quick-start) Download or clone one of our official examples
-- [Build a project from scratch](../build-from-scratch) - A guide to building a TanStack Start project line-by-line, file-by-file.
+- [Build a project from scratch](./build-from-scratch) - A guide to building a TanStack Start project line-by-line, file-by-file.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
- [TanStack Start CLI](../quick-start) - Just run `npm create @tanstack/start@latest`. Local, fast, and optionally customizable | |
- [TanStack Builder](#) (coming soon!) - A visual interface to configure new TanStack projects with a few clicks | |
- [Quick Start Examples](../quick-start) Download or clone one of our official examples | |
- [Build a project from scratch](../build-from-scratch) - A guide to building a TanStack Start project line-by-line, file-by-file. | |
- [TanStack Start CLI](./quick-start) - Just run `npm create @tanstack/start@latest`. Local, fast, and optionally customizable | |
- [TanStack Builder](#) (coming soon!) - A visual interface to configure new TanStack projects with a few clicks | |
- [Quick Start Examples](./quick-start) Download or clone one of our official examples | |
- [Build a project from scratch](./build-from-scratch) - A guide to building a TanStack Start project line-by-line, file-by-file. |
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
18-18: No empty links
(MD042, no-empty-links)
🤖 Prompt for AI Agents
In docs/start/framework/react/getting-started.md around lines 17 to 20, the
three internal links use ../... which drops the react/ segment and breaks
navigation; update those links to use relative paths starting with ./ (e.g.,
./quick-start and ./build-from-scratch) so they resolve within the current
framework/react directory and point to the correct pages.
Currently, the link from
getting-started
tomigrate-from-next-js
is broken. This PR corrects the relative path to the migration guide.Relevant page in prod deployment
Summary by CodeRabbit