Skip to content

fix(docs): resolve documentation search in documentation header#29245

Merged
romitg2 merged 4 commits intocalcom:mainfrom
PSNY-23:fix-docs-search-index
May 3, 2026
Merged

fix(docs): resolve documentation search in documentation header#29245
romitg2 merged 4 commits intocalcom:mainfrom
PSNY-23:fix-docs-search-index

Conversation

@PSNY-23
Copy link
Copy Markdown
Contributor

@PSNY-23 PSNY-23 commented Apr 30, 2026

Fixes #29241

How to reproduce

See issue #29241 for reproduction steps.

Summary

The “Search documentation” input box was not working due to a missing Pagefind package required by Nextra. This PR fixes the issue by adding the pagefind package and configuring the docs build process correctly.

Since Nextra’s search feature only works in production builds, a postbuild script has been added to the docs package.json to ensure the search index is generated after the build step.

Changes made

  • Added missing pagefind dependency required for documentation search
  • Added postbuild script to generate search index after docs build
  • Ensured compatibility with Nextra production-only search behavior
  • Updated .gitignore to exclude Pagefind build output directory

Testing

  • Built docs using yarn turbo run build --filter=@calcom/docs
  • Verified Pagefind index is generated in build output
  • Served production build and tested search functionality
  • Confirmed no console errors

Image Demo:

Before

Search input was showing an error and not returning results.
image

After

Search works correctly and returns documentation results.
image

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

@github-actions
Copy link
Copy Markdown
Contributor

Welcome to Cal.diy, @PSNY-23! Thanks for opening this pull request.

A few things to keep in mind:

  • This is Cal.diy, not Cal.com. Cal.diy is a community-driven, fully open-source fork of Cal.com licensed under MIT. Your changes here will be part of Cal.diy — they will not be deployed to the Cal.com production app.
  • Please review our Contributing Guidelines if you haven't already.
  • Make sure your PR title follows the Conventional Commits format.

A maintainer will review your PR soon. Thanks for contributing!

@github-actions github-actions Bot added the 🐛 bug Something isn't working label Apr 30, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 30, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 92d23871-92b3-4cd7-876a-2f601997b087

📥 Commits

Reviewing files that changed from the base of the PR and between 7c6a179 and b365267.

📒 Files selected for processing (1)
  • apps/docs/package.json
✅ Files skipped from review due to trivial changes (1)
  • apps/docs/package.json

📝 Walkthrough

Walkthrough

Adds a .gitignore rule to exclude the _pagefind/ directory. Updates the docs app build workflow to run Pagefind after next build, targeting .next/server/app and emitting search assets to public/_pagefind. Adds pagefind (^1.5.2) to the docs app dependencies.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main fix: resolving documentation search in the docs header by adding Pagefind support.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, explaining the root cause (missing Pagefind), changes made, and testing performed.
Linked Issues check ✅ Passed The PR addresses the linked issue #29241 by implementing the Pagefind package and postbuild script to fix the 'Failed to load search index' error, restoring search functionality as required.
Out of Scope Changes check ✅ Passed All changes align with fixing issue #29241: .gitignore addition for build artifacts and package.json modifications for Pagefind integration are both in-scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@Qodo-Free-For-OSS
Copy link
Copy Markdown

Hi, The docs build now requires the pagefind CLI via postbuild, but it’s declared as a devDependency, which will break docs builds in environments that install production dependencies only.

Severity: remediation recommended | Category: reliability

How to fix: Move pagefind to dependencies

Agent prompt to fix - you can give this to your LLM of choice:

Issue description

Docs postbuild executes pagefind, but pagefind is listed under devDependencies. Any environment that installs only production dependencies during build will fail because the pagefind binary won’t exist.

Issue Context

  • postbuild runs pagefind --site ... --output-path public/_pagefind.
  • pagefind is declared under devDependencies.

Fix Focus Areas

  • apps/docs/package.json[5-10]
  • apps/docs/package.json[18-22]

Implementation notes

  • Move pagefind from devDependencies to dependencies, or ensure the build/install pipeline always includes devDependencies for the docs build step (document/enforce via CI configuration if that is the intended model).

Qodo code review - free for open-source.

@romitg2 romitg2 added ready-for-e2e run-ci Approve CI to run for external contributors labels May 3, 2026
Merge postbuild script into build command to ensure pagefind runs
in all CI environments (Vercel, Turbo, yarn workspace).
@romitg2 romitg2 added run-ci Approve CI to run for external contributors and removed run-ci Approve CI to run for external contributors labels May 3, 2026
@romitg2 romitg2 enabled auto-merge (squash) May 3, 2026 09:03
@romitg2 romitg2 merged commit e64de00 into calcom:main May 3, 2026
55 of 56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working ready-for-e2e run-ci Approve CI to run for external contributors size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search documentation input box on the header is not working.

3 participants