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

Failed to load search index in production/built versions #4281

Open
patrickdevivo opened this issue Feb 27, 2025 · 4 comments
Open

Failed to load search index in production/built versions #4281

patrickdevivo opened this issue Feb 27, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@patrickdevivo
Copy link

Describe the bug
I have a nextra deployment which maybe uses an unconventional setup. I have the docs site hosted at /docs and then a landing page at the root / (and some other non docs pages like /pricing). So I have two route groups (landing) and (docs) which have two root layouts - one for Nextra and the other for my other pages. I'm not sure if this setup is impacting the following error, which I'm seeing consistently when I try to search in my docs:

Image

To Reproduce Steps to reproduce the behavior:

This is actually a live error right now on a deployed website: https://www.hybound.com/docs - you can visit that site and try to search.

Expected behavior A clear and concise description of what you expected to
happen.

Search should work without the error 😃

Screenshots If applicable, add screenshots to help explain your problem.

(Please above)

Desktop (please complete the following information):

  • OS: macOS
  • Browser Chrome
  • Version 133.0.6943.127 (Official Build) (x86_64)

Smartphone (please complete the following information):

N/A

Additional context Add any other context about the problem here.

@patrickdevivo patrickdevivo added the bug Something isn't working label Feb 27, 2025
@dimaMachina
Copy link
Collaborator

Hi, does search work locally? can you provide reproduction?

@87xie
Copy link
Contributor

87xie commented Feb 27, 2025

I'm not sure if I understood it correctly, but it seems like there are two separate Next.js applications, with the docs site deployed under the /docs subpath. Perhaps adding basePath: '/docs' to the next.config.js file in the docs site application could help resolve this?

@patrickdevivo
Copy link
Author

@dimaMachina search does not work locally.

@87xie so it's one single Next.js application, however it's using two root layouts, as described here.

So the folder structure is:

- (docs)
  - docs
  - layout.tsx <--- nextra docs theme layout 
- (landing)
  - pricing
  - layout.tsx 

I will try fiddling with the basePath config thanks

@87xie
Copy link
Contributor

87xie commented Feb 28, 2025

Thanks for your explanation, and basePath is unnecessary.

I noticed that the Nextra docs on search are outdated for v4. Could you try following these steps to see if they work?

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

3 participants