Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Searching for 'search' returns no results in Safari on Mac and iPhone #915

Closed
martinbira opened this issue Nov 9, 2018 · 11 comments
Closed
Labels
bug Issue reports a bug

Comments

@martinbira
Copy link
Sponsor Contributor

Description

When searching for the word search no results are found for Safari users on Mac and iPhone. Tested on iPhone X using Safari, Mac using Safari and Chrome, as well as Win 10 with Microsoft Edge, Chrome, Firefox, and Vivaldi browsers.

Expected behavior

Pages where the word search should appear in the search results.

Actual behavior

No results found for the word search in the search results.

Steps to reproduce the bug

  1. Have page with the word search in the search_index.json
  2. Search for search.

Package versions

  • Python: 3.6.1
  • MkDocs: 1.0.4
  • Material: 3.0.6

System information

  • OS: OS X
  • Browser: Safari
@squidfunk
Copy link
Owner

Hmm, works in the official docs:

bildschirmfoto 2018-11-09 um 14 53 16

Safari, macOS

@martinbira
Copy link
Sponsor Contributor Author

Indeed it does. I'll take another look at my search index!

@squidfunk squidfunk added the needs reproduction Issue lacks a minimal reproduction .zip file label Nov 10, 2018
@martinbira
Copy link
Sponsor Contributor Author

martinbira commented Nov 13, 2018

So I've been going over the issue with two of our Mac users here and they both report the same console errors in Safari, which may have something to do with the indexing. We've used both our full search index straight from mkdocs build and our slightly modified index with the same results.

application.5e60981f.js 
Line 2434:77 undefined is not an object (evaluating 'm._index')

safari_console_error

@squidfunk
Copy link
Owner

squidfunk commented Nov 14, 2018

This error occurs in the source of lunr.js, not Material. It could, however, be related to some invalid value that is passed to lunr.js. Could you try narrowing it further down?

EDIT: Does this also happen with the default MkDocs theme or only with Material?

@martinbira
Copy link
Sponsor Contributor Author

This is not reproducable on mkdocs.org. We see it on Material directly when entering a key, such as j as in the following screenshot.

safari_console_official_page

@squidfunk
Copy link
Owner

Awesome, I can also reproduce it now. Thanks for investigating. I will debug it when I find the time, most likely by the beginning of next week. If somebody else wants to go ahead, feel free to PR!

@max-ci
Copy link

max-ci commented Nov 14, 2018

Isn't it related to olivernn/lunr.js#279?

@martinbira
Copy link
Sponsor Contributor Author

It sure looks similiar after a quick glance.

@squidfunk squidfunk added bug Issue reports a bug and removed needs reproduction Issue lacks a minimal reproduction .zip file labels Nov 15, 2018
@squidfunk
Copy link
Owner

Indeed, it looks like it's related to the issue posted by @max-ci. I skimmed through the issue and it seems that 2.3.1 includes a fix for this, so we could bump lunr.js to the current version and try if that fixes the problem.

@squidfunk
Copy link
Owner

I upgraded to Lunr 2.3.5 and it seems fixed. I will issue a release within a few minutes.

@squidfunk
Copy link
Owner

Released as part of 3.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue reports a bug
Projects
None yet
Development

No branches or pull requests

3 participants