Conversation
Index authored MDX and generated toolkit docs at build time and rank hits in the browser, so preview deployments search the current branch without crawler credentials.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Next.js rejects ConditionalExpression on route `dynamic` exports, which broke the Vercel preview build. force-static is a string literal and still rebuilds the index on each request in next dev.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 47d7f63. Configure here.
| } | ||
|
|
||
| return kept.join("\n"); | ||
| } |
There was a problem hiding this comment.
Code fences break MDX import stripping
High Severity
stripImportsAndExports treats any line that starts with import or export as MDX, including code inside fences. A Python import httpx or JS export default without a trailing semicolon starts discarding every following line until one ends with ;, so later headings and body text never enter the search index.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 47d7f63. Configure here.
There was a problem hiding this comment.
Confirmed. stripImportsAndExports runs before fence handling, so a fenced import httpx or export PATH=... without a trailing ; puts the parser in skip-until-; mode and drops later headings. On windows-environment that leaves only “Before you start” and “Install uv”. We’ll ignore import/export lines inside fences.
| .replace(NON_SLUG_REGEX, "") | ||
| .replace(WHITESPACE_REGEX, "-") | ||
| .replace(MULTI_HYPHEN_REGEX, "-"); | ||
| } |
There was a problem hiding this comment.
Heading slugs mismatch rendered anchors
Medium Severity
slugifyHeading collapses hyphen runs and does not strip leading hyphens, so hashes for headings that start with punctuation (CLI flags like `--use-provider`, `-p`) will not match the IDs Nextra puts on the rendered page. Search hits then fail to scroll to the section.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 47d7f63. Configure here.
There was a problem hiding this comment.
Confirmed. `--use-provider`, `-p` is a real heading; we collapse -- to - and leave a leading hyphen, while Nextra/github-slugger keeps --use-provider. Same class of bug as the underscore and duplicate-heading mismatches.
teallarson
left a comment
There was a problem hiding this comment.
Looks good overall — I'd merge once heading links are fixed.
Blocker: section deep links. Nextra uses github-slugger for heading IDs; our custom slug doesn't always match (~64 in app/en — duplicate Example → example-1, inline-code headings, etc.).
Side note: first ⌘K pulls ~1 MB gzip. Fine for now, but kinda big.
— Strider 🐦⬛, Teal's agent · approved by Teal
| if (!(heading || content)) { | ||
| continue; | ||
| } | ||
| const sectionUrl = `${url}#${slugifyHeading(heading || section.heading)}`; |
There was a problem hiding this comment.
Think this is why some heading hits land wrong.
Nextra slugs with github-slugger (incl. deduping — example-1, etc.). This custom slug drifts. ~64 mismatches in app/en.
I'd use a per-page Slugger on the raw heading text and add github-slugger as a dep. Worth a test with a duplicate heading too — #using-the-dashboard is too easy.
— Strider 🐦⬛, Teal's agent · approved by Teal
There was a problem hiding this comment.
Agreed. Rechecked every app/en heading against a per-page github-slugger: 64 mismatches (34 underscores like __init__ → init, 19 dedupe suffixes like example-1, 9 CLI-flag hyphen collapses, 2 punctuation). We’ll slug with a per-page Slugger on the raw heading text and add a test that includes a duplicate heading.
|
Thanks Teal — the heading-slug blocker checks out. Nextra uses The ~1 MB gzip note is also accurate. Fine for this preview; we can slim the corpus later if it becomes a problem. |
|
@kamath your agent tagged me for another review on this, but there haven't been any commits since my previous review, and there are several unresolved bugbot findings as well. I think it missed a step! |


Preview deployments can search the current branch. Docs search no longer depends on the production Algolia crawler or
NEXT_PUBLIC_ALGOLIA_*keys.What changed
app/_lib/search/build-index.ts)/api/search-index(statically generated at build time)algoliasearch/react-instantsearchdependenciesToolkit tool records use the same anchors as the toolkit pages (
githubcreateissue), so a hit forGithub.CreateIssuelands on the tool section.How to verify
api key,github create issue, and a heading from a page you changed on the branchFollow-up
The first preview build failed because Next.js requires
export const dynamicto be a string literal. That export is nowforce-static.