emersonbottero / vitepress-plugin-search

Provide local search to your documentation site.
MIT License
238 stars 30 forks source link

Already installed plugin and configured it in cofig.js, but no Search Bar appears in website after running 'yarn docs:dev' #54

Closed fun-enterprises closed 1 year ago

fun-enterprises commented 1 year ago

Hello,

As described in title of this issue, I see no Search Bar appearing in the page.

I believe I followed the instructions correctly. Can you help me identify in what is it that I am failing?

Screenshots:

Screen Shot 2023-02-07 at 3 48 06 PM Screen Shot 2023-02-07 at 3 48 45 PM

Repo: https://github.com/fun-enterprises/business

Github Pages: https://fun-enterprises.github.io/business

Thank you

emersonbottero commented 1 year ago

but the docs said to use it in the vite.config.js

see demo example you don't need the server options

fun-enterprises commented 1 year ago

you are correct about the name of the file, my fault. however, I tried correcting it and it didn't work.

I am operating under this assumptions:

any hint on why it doesn't work?

I don't understand what component uses 'vite.config.js' anyway. I couldn't find that in any documentation.

thank you for your patience, I'm just starting with vitepress and vite some things are not obvious to me yet.

vitepress is a vite application and this plugin is a vite plugin.. https://vitejs.dev/guide/using-plugins.html#adding-a-plugin

fun-enterprises commented 1 year ago

Here's what I tried :

Screen Shot 2023-02-07 at 9 25 29 PM
zqy233 commented 1 year ago

Here's what I tried :

Screen Shot 2023-02-07 at 9 25 29 PM

vitepress uses Vite under the hood,vite.config.js or vite.config.ts is configuration file,you should put it like this image

emersonbottero commented 1 year ago

@zqy233 , your vitepress application settings is all wrong, even removing this plugin it wont run.. first make sure you vitepress is working.. the issue with your repo is inside .vitepress there should only be an config.js and nothing else remove the theme subfolders inside of it delete cache inside .vitepress aldo delete node_modules and pachage-lock.json then run npm i

npm run docs:dev and it should work image

emersonbottero commented 1 year ago

@fun-enterprises the settings should be places in a vite.config.js file at the root of docs

![Uploading image.png…]()

fun-enterprises commented 1 year ago

I was able to solve my problem by doing exactly what you told me.

thank you @emersonbottero. now the search component appears in the UI.