docsifyjs / docsify

🃏 A magical documentation site generator.
https://docsify.js.org
MIT License
27.72k stars 5.68k forks source link

search plugin not working #1002

Closed fish7dining closed 3 months ago

fish7dining commented 4 years ago

Bug Report

Steps to reproduce

  1. add '' in index.html

What is current behaviour

  1. the search button show up, but whateever i search, it returns no result.

What is the expected behaviour

  1. i hope it can show the results what i search.

Other relevant information

anikethsaha commented 4 years ago

whats the error or logs ? share your config as well.

computerphilosopher commented 4 years ago

I got error log from chrome developer tool when I tried searching.(search result was 'No result')

search.js:275 Uncaught TypeError: Cannot read property 'classList' of null
    at doSearch (search.js:275)
    at search.js:293

here is my index.html

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>ARCUS DOCS</title>
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <meta name="description" content="Description">
  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/css/theme-simple.css">

  <style>
        :root {
            --base-font-size:16px;
        }
  </style>
</head>
<body>
  <div id="app"></div>
  <script>
    window.$docsify = {
      name: 'ARCUS DOCS',
      repo: 'naver/arcus',
      relativePath: true,
      loadNavbar: true,
      markdown: {
          gfm: true,
          break: true,
      }
      // complete configuration parameters
      search: {
        maxAge: 86400000, // Expiration time, the default one day
        paths: 'auto',
        placeholder: 'Type to search',
        noData: 'No Results!',
        // Headline depth, 1 - 6
        depth: 6,
        hideOtherSidebarContent: false, // whether or not to hide other sidebar content
     }
    }
  </script>
  <script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
  <script src="//unpkg.com/prismjs/components/prism-bash.min.js"></script>
  <script src="//unpkg.com/prismjs/components/prism-c.js"></script>
  <script src="//unpkg.com/prismjs/components/prism-cpp.js"></script>
  <script src="//unpkg.com/prismjs/components/prism-java.js"></script>
  <script src="//unpkg.com/docsify-copy-code"></script>
  <script src="//unpkg.com/docsify-pagination/dist/docsify-pagination.min.js"></script>
  <script src="//unpkg.com/docsify/lib/plugins/search.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/docsify-themeable@0"></script>
</body>
</html>
stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.