docsearch
docsearch copied to clipboard
Recent Searches is always empty
Description
We're using the latest @docsearch/js
alpha and the the Recent Searches never update. I spent a few months in your Discord trying to get answers but still haven't figured out why. No one seems to have a clue, and the site is really quite simple.
Steps to reproduce
- Go to https://statamic.dev
- Search for anything
- Search as many more times as you want and you'll never see anything in the Recent Searches modal.
Expected behavior
Like other sites using the same version (TailwindCSS.com for example), I'd expect to see that list update.
Environment
- OS: All
- Browser: All
- DocSearch version: 3.0.0-alpha-42
- Project Repo: https://github.com/statamic/docs
- Implementation: https://github.com/statamic/docs/blob/master/resources/js/app.js#L16-L33
Hey @jackmcdade, sorry but I don't really know Laravel, so I have a few noob questions.
- Would it be possible that there's a limitation between those two environments that does not allow us to use the localStorage?
- Do you have any other use of the localStorage?
- If not, could you please try using it to see if it's related to DocSearch
- If yes, could you please define a simple use of the
localStorage
in thetransformItems
function for example
Laravel is all server-side PHP and just renders HTML, nothing there would interfere with client-side JS.
We have one little helper plugin that lets us set and remove a key from localStorage
, but even after removing it, the Recent Searches is still empty.
So you are able to use localStorage from something else than DocSearch right?
Our usage is really basic, but it's also possible that it comes from that check we do. Could you try to comment it and see if it works?
Yes, no issues working with localStorage. I commented out that block and still, nada. 🤔
Any chance you can look at this in the next month or so? Been trying to figure this one out off-and-on since September.