Skip to content
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

search not working on vercel with remote content #580

Closed
Codeize opened this issue Jul 7, 2024 · 4 comments
Closed

search not working on vercel with remote content #580

Codeize opened this issue Jul 7, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@Codeize
Copy link

Codeize commented Jul 7, 2024

To Reproduce

  1. Follow the guide on remote content using GitHub: https://fumadocs.vercel.app/docs/headless/remote/github
  2. Deploy to production on Vercel

Current vs. Expected behavior

Even whilst running the app in production mode locally, it builds the search index as I expect it to, and then the search functionality itself works as I expect it to.

However, when deploying onto Vercel - according to the build logs - it builds the search index correctly, however when searching for the same content as I did locally it returns no results.

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Home
  Available memory (MB): 16307
  Available CPU cores: 16
Binaries:
  Node: 22.2.0
  npm: 10.7.0
  Yarn: N/A
  pnpm: 9.2.0
Relevant Packages:
  next: 14.2.4 // Latest available version is detected (14.2.4).
  eslint-config-next: N/A
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.4.5
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Core, MDX

Additional context

I have altered the setup to remove /docs being the root, and instead / being the root, as for our use case the docs would be hosted as a separate website to the main website. Albeit unlikely, maybe this has broken something?

@Codeize Codeize added the bug Something isn't working label Jul 7, 2024
@fuma-nama
Copy link
Owner

How do you setup search API? Are you using 3rd party solutions like Algolia Search, or using your own implementation?

@Codeize
Copy link
Author

Codeize commented Jul 7, 2024

I am just using the out-of-the-box solution provided by the remote MDX example, createSearchAPI:

@fuma-nama
Copy link
Owner

Don't use that example in production, it's not compatible with serverless runtime. It's just for experimental purposes. As we recommended, use 3rd party solutions like Algolia Search.

Otherwise, using the Fumadocs built-in search, it requires a redeployment when your content changes, which wasted the optimisation of MDX remote.

@Codeize
Copy link
Author

Codeize commented Jul 7, 2024

Alright, thank you.

@Codeize Codeize closed this as completed Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants