vuepress / core

Vue-Powered Static Site Generator
https://vuepress.vuejs.org
MIT License
2.33k stars 923 forks source link

Local search box not show [Bug report] #237

Closed shengzhou1216 closed 3 years ago

shengzhou1216 commented 3 years ago

Bug report

Local search box not show

Description

Search box for Local Search Index is not showing in the navbar. I follow this document

Steps to reproduce

  1. init vuepress 2 project I am followed this document
  2. add dependency
    yarn add -D @vuepress/plugin-search
  3. config search plugin
    plugins: [
        [
            '@vuepress/plugin-search'
        ]
    ]

Expected behavior

can seeing a search box in navbar.

Screenshots

FireShot Capture 044 - Hello VuePress - - localhost as you can see , there is no search box show in navbar.

Environment info

# Paste output of `vuepress info` here
System:
    OS: Linux 5.8 Ubuntu 20.04.2 LTS (Focal Fossa)
    CPU: (16) x64 Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz
    Memory: 11.01 GB / 62.73 GB
    Shell: 5.8 - /usr/bin/zsh
  Binaries:
    Node: 16.4.0 - /usr/bin/node
    Yarn: 1.22.10 - /usr/bin/yarn
    npm: 7.18.1 - /usr/bin/npm
  Utilities:
    Git: 2.32.0 - /usr/bin/git
  Browsers:
    Chrome: 91.0.4472.114
    Firefox: 89.0.1
  npmPackages:
    @vuepress/bundler-vite: Not Found
    @vuepress/bundler-webpack:  2.0.0-beta.19 
    @vuepress/cli:  2.0.0-beta.19 
    @vuepress/client:  2.0.0-beta.19 
    @vuepress/core:  2.0.0-beta.19 
    @vuepress/markdown:  2.0.0-beta.19 
    @vuepress/plugin-active-header-links:  2.0.0-beta.19 
    @vuepress/plugin-back-to-top:  2.0.0-beta.19 
    @vuepress/plugin-container:  2.0.0-beta.19 
    @vuepress/plugin-debug: Not Found
    @vuepress/plugin-docsearch: Not Found
    @vuepress/plugin-git:  2.0.0-beta.19 
    @vuepress/plugin-google-analytics: Not Found
    @vuepress/plugin-medium-zoom:  2.0.0-beta.19 
    @vuepress/plugin-nprogress:  2.0.0-beta.19 
    @vuepress/plugin-palette:  2.0.0-beta.19 
    @vuepress/plugin-prismjs:  2.0.0-beta.19 
    @vuepress/plugin-pwa: Not Found
    @vuepress/plugin-pwa-popup: Not Found
    @vuepress/plugin-register-components: Not Found
    @vuepress/plugin-search: ^1.8.2 => 1.8.2 
    @vuepress/plugin-shiki: Not Found
    @vuepress/plugin-theme-data:  2.0.0-beta.19 
    @vuepress/plugin-toc: Not Found
    @vuepress/shared:  2.0.0-beta.19 
    @vuepress/theme-default:  2.0.0-beta.19 
    @vuepress/utils:  2.0.0-beta.19 
    vue:  3.1.2 
    vue-loader:  16.2.0 
    vue-router:  4.0.10 
    vuepress: ^2.0.0-beta.19 => 2.0.0-beta.19 
    vuepress-vite: Not Found
Mister-Hope commented 3 years ago

Use v2 with next flag please

shengzhou1216 commented 3 years ago

you mean yarn add -D vuepress@next ? This is the command I use

Mister-Hope commented 3 years ago

I mean

yarn add -D @vuepress/plugin-search@next

Why do you think a plugin compatable with vuepress@next should be under the latest tag intead of the same next flag?

Mister-Hope commented 3 years ago

Just a kind reminder, if you are not familiar with node and vue3, I personally do not recommand you to try things which has not yet touched stable.

shengzhou1216 commented 3 years ago

It's works now. I didn't know the difference between the different tags and thought it should be backward compatible. I am not familiar with vue3 , and new to vuepress , so choose the latest version. Thank you for you remind.

Mister-Hope commented 3 years ago

You can try vuepress@v1 (latest), which you would not likely to run in to some issues, and switch to v2 later when it is published as latest.