cmfcmf / docusaurus-search-local

Offline / Local Search for Docusaurus v2. Try it live at:
https://cmfcmf.github.io/OpenWeatherMap-PHP-API/
MIT License
438 stars 67 forks source link

search-index-default.json doesn't exist. #85

Closed hossein-zare closed 2 years ago

hossein-zare commented 2 years ago

Please describe the bug you are seeing

Hello, Untitled

When i start typing it's trying to GET https://hossein-zare.github.io/react-native-dropdown-picker-website/search-index-default.json 404 but it doesn't exist.

Untitled

How can we best reproduce the bug?

No response

Which version of Docusaurus and @cmfcmf/docusaurus-search-local are you using?

"@cmfcmf/docusaurus-search-local": "^0.9.0",
"@docusaurus/core": "2.0.0-beta.13",

Which Node.js version are you using?

v16.13.0

Which theme are you using?

Yes, I am using @docusaurus/theme-classic

How does your plugin config look like?

plugins: [require.resolve("@cmfcmf/docusaurus-search-local")],

Additional context

https://hossein-zare.github.io/react-native-dropdown-picker-website

cmfcmf commented 2 years ago

Thank you for rasing this issue! I fixed the code by no longer erroring when a particular search index does not exist. While this is not ideal, since it still does one unnecessary HTTP request, I hope that this is a decent intermediate solution.

cmfcmf commented 2 years ago

Released in 0.9.1 - let me know if it works for you 🚀

hossein-zare commented 2 years ago

Thanks it's working fine now, The search results are ok. 😁 But the error is still there, I shouldn't be worried as you said it's no big deal.

jafin commented 2 years ago

@cmfcmf I am receiving a similar error. (v0.9.3)

Missing file search-index-default.json returns 500 error from server

Result from search is no results. Error in console:

main.7c543ba5.js:formatted:4931 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'fieldVectors')
    at Function.A.Index.load (main.7c543ba5.js:formatted:4931:27)
    at main.7c543ba5.js:formatted:3819:49
    at c (main.7c543ba5.js:formatted:25321:32)
    at Generator._invoke (main.7c543ba5.js:formatted:25299:37)
    at Generator.next (main.7c543ba5.js:formatted:25351:37)
    at r (main.7c543ba5.js:formatted:197:29)
    at l (main.7c543ba5.js:formatted:211:25)

I'm new to docusaurus, I'll see if I can unminify this error to better understand the error. If I place a dummy json file with the above name, search works as expected.

cmfcmf commented 2 years ago

Thank you for reporting, debugging and fixing this! Released the fix in v0.9.4.