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

Searchbar is not working #52

Open
dscampero opened this issue Jan 12, 2024 · 5 comments
Open

Searchbar is not working #52

dscampero opened this issue Jan 12, 2024 · 5 comments

Comments

@dscampero
Copy link

I have cloned the Doc Template shared in Github and I have noticed that it is not working. When I write to search for something the application does not show anything other than the first page (Introduction, etc...)
However, in the demo version deployed in Vercel it does work.
Can someone help me solve this problem?

@Fedec96
Copy link

Fedec96 commented Jun 7, 2024

The search function searches only if all the pages are compiled, which is not the case when you're running the development server, and explains why it works on Vercel.

If you build your application locally and boot it with npm run start rather than npm run dev, you'll see it working locally too.

@liringlas
Copy link

The search function searches only if all the pages are compiled, which is not the case when you're running the development server, and explains why it works on Vercel.

If you build your application locally and boot it with npm run start rather than npm run dev, you'll see it working locally too.

Did not work for me.
I have around 80 pages, specific documentation with different methods.
Search finds some previously created pages, but does not see new ones.
Yet I see SSG works fine and I've HTML/JS chunks in .next/server/pages folder.

@liringlas
Copy link

It seems that for some reason no data being passed into chunks/nextra-data-en-US.json` for new pages.
Any idea why that could happen?
Pages on SSG are fully populated with content.

Screenshot 2024-06-27 at 12 26 59

@Fedec96
Copy link

Fedec96 commented Jun 27, 2024

Did not work for me. I have around 80 pages, specific documentation with different methods. Search finds some previously created pages, but does not see new ones. Yet I see SSG works fine and I've HTML/JS chunks in .next/server/pages folder.

One thing you could consider trying is removing the node_modules & .next folders and re-run npm i before building and starting. Might be something related to cache. I have automated this process by creating a pre-build script (TS + esno).

@liringlas
Copy link

liringlas commented Jun 27, 2024

Did not work for me. I have around 80 pages, specific documentation with different methods. Search finds some previously created pages, but does not see new ones. Yet I see SSG works fine and I've HTML/JS chunks in .next/server/pages folder.

One thing you could consider trying is removing the node_modules & .next folders and re-run npm i before building and starting. Might be something related to cache. I have automated this process by creating a pre-build script (TS + esno).

Looks like pure on-page Markdown content is being parsed and okay for search and nextra-data.
However I have .tsx components rendered on the whole page, and they seem to be omitted by search/nextra data json.

Any known way to make React components content on MDX page also be searchable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants