docsify: Search Plugin Not Working

Bug Report

Steps to reproduce

fist time open docsify website , search plugin is working correct , after click some page , search-min.js throw error ,and search plugin not working any more , type something to search won’t get any thing response

What is current behaviour

when open some page

search.min.js:1 Uncaught TypeError: Cannot read property '/./IOT%E5%AE%89%E5%85%A8/360/360%20Phone%20N6%20Pro%E5%86%85%E6%A0%B8%E6%BC%8F%E6%B4%9E' of null
    at search.min.js:1
    at Array.forEach (<anonymous>)
    at i (search.min.js:1)
    at search.min.js:1
    at o (docsify.min.js:1)
    at o (docsify.min.js:1)
    at B (docsify.min.js:1)
    at r (docsify.min.js:1)
    at docsify.min.js:1
    at docsify.min.js:1

image

type something to search

search.min.js:1 Uncaught TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at c (search.min.js:1)
    at r (search.min.js:1)
    at search.min.js:1

image

What is the expected behaviour

Other relevant information

  • Bug does still occur when all/other plugins are disabled?

  • Your OS:

  • Node.js version:

  • npm/yarn version:

  • Browser version:

  • Docsify version: newest

  • Docsify plugins: search

Please create a reproducible sandbox

Edit 307qqv236

Mention the docsify version in which this bug was not present (if any)

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 29 (18 by maintainers)

Most upvoted comments

weird, from which version this is happening ?

IMHO, I think the problem since we set the search.index in local storage. As we all know, the browsers have default local storage size (about 5 M), and we stored all the markdown files strings as search.index in local storage. If the files strings r humongous (more than 5 M), we can’t set it in the local storage and cause the search err aboved.

https://github.com/wzpan/hexo-generator-search

Maybe you can refer to this save all markdown file strings to a local xml file

weird, from which version this is happening ?

IMHO, I think the problem since we set the search.index in local storage. As we all know, the browsers have default local storage size (about 5 M), and we stored all the markdown files strings as search.index in local storage. If the files strings r humongous (more than 5 M), we can’t set it in the local storage and cause the search err aboved.

by the way , ios device still have this problem after changed to search.js try here https://ares-x.com/wiki/ device: iphone 6s plus ios version: 13.7