Skip to content

Search Plugin - Some terms dont give results #1876

Closed
@LuGr-01

Description

@LuGr-01

I do not know if its my own fault or if this is a bug... 🧐

I'm using the docsify (v4.12.2) search plugin. Some search terms don't deliver a result, not even a "No results!" is returned. When typing in the search field the Error "Uncaught TypeError: c is undefined" is logged in the web console for each typed character of the browser.

grafik

With other patterns a "No results!" is indeed returned. It would even be enough to add a character after the above used word to return a result.

188431823-1c07b9c4-3e1c-4d96-888b-adaeacfef9a5
grafik

And other words give the expected results.

188431663-ddfb6510-6f6a-451a-a2f5-6b4db1ec8e42

My index.html

<!DOCTYPE html>
<html lang="en">
 <head>
    <meta charset="UTF-8" />
    <title>Document</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="description" content="Description" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />

    <link rel="stylesheet" href="node_modules/docsify-themeable/dist/css/theme-defaults.css" />
 </head>
 <body>
    <div id="app"></div>
    <script>
       var lang = location.hash.match(/#\/(de|en)\//);

       if (lang) {
          document.documentElement.setAttribute('lang', lang[1]);
       }

       window.$docsify = {
          auto2top: true,
          themeColor: '#be1a47',
          name: 'Mandy Docs',
          repo: '',
          loadSidebar: true,
          loadNavbar: true,
          mergeNavbar: true,
          maxLevel: 5,
          subMaxLevel: 3,
          alias: {
             '/de/(.*)': '/de/$1',
             '/en/(.*)': '/en/$1',
             '/(.*)': '/en/$1',
          },
          search: {
             paths: 'auto',
             noData: {
                '/de/': 'Keine Ergebnisse!',
                '/en/': 'No results!',
                '/': 'No results!',
             },
             placeholder: {
                '/de/': 'Suche',
                '/en/': 'Search',
                '/': 'Search',
             },

             hideOtherSidebarContent: true,
             pathNamespaces: ['/en', '/de'],
          },
          nameLink: {
             '/en/': '#/en/',
             '/de/': '#/de/',
             '/': '#/en/',
          },
       };
    </script>
    <script src="node_modules/docsify/lib/docsify.min.js"></script>
    <script src="node_modules/docsify/lib/plugins/search.min.js"></script>
    <script src="node_modules/docsify/lib/plugins/emoji.min.js"></script>

    <script src="node_modules/docsify-copy-code/dist/docsify-copy-code.min.js"></script>
    <script src="node_modules/docsify-pagination/dist/docsify-pagination.min.js"></script>

    <script src="node_modules/docsify-themeable/dist/js/docsify-themeable.min.js"></script>
 </body>
</html>

My folder structure looks like:

📦docs
┣ 📂de
┃ ┣ 📂folder
┃ ┃ ┣ 📜file.md
┃ ┃ ┣ 📜file.md
┃ ┣ 📂folder
┃ ┃ ┣ 📜file.md
┃ ┃ ┣ 📜file.md
┃ ┣ 📜CHANGELOG.md
┃ ┣ 📜README.md
┃ ┣ 📜_navbar.md
┃ ┗ 📜_sidebar.md
┣ 📂en
┃ ┣ 📂folder
┃ ┃ ┣ 📜file.md
┃ ┃ ┣ 📜file.md
┃ ┣ 📂folder
┃ ┃ ┣ 📜file.md
┃ ┃ ┣ 📜file.md
┃ ┣ 📜CHANGELOG.md
┃ ┣ 📜README.md
┃ ┣ 📜_navbar.md
┃ ┗ 📜_sidebar.md
┣ 📂node_modules
┣ ...
┣ 📜favicon.ico
┣ 📜index.html
┣ 📜package-lock.json
┗ 📜package.json

Example Repo here:

https://github.com/LuGrInaut/docsify-search-not-working

Open in StackBlitz

I already searched the GitHub Issues for topics regarding the search topic but I'm not sure if this has something to do with the Indexes in the Local Browser Storage or with something else.

Thanks,
Lukas

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugconfirmed as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions