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

Comments

Projects
None yet
3 participants
@martinbira
Copy link
Contributor

martinbira commented Nov 9, 2018

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

This comment has been minimized.

Copy link
Owner

squidfunk commented Nov 9, 2018

Hmm, works in the official docs:

bildschirmfoto 2018-11-09 um 14 53 16

Safari, macOS

@martinbira

This comment has been minimized.

Copy link
Contributor

martinbira commented Nov 9, 2018

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

@martinbira

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor

martinbira commented Nov 14, 2018

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

This comment has been minimized.

Copy link
Owner

squidfunk commented Nov 14, 2018

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

This comment has been minimized.

Copy link

max-ci commented Nov 14, 2018

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

@martinbira

This comment has been minimized.

Copy link
Contributor

martinbira commented Nov 14, 2018

It sure looks similiar after a quick glance.

@squidfunk squidfunk added bug and removed not reproducible labels Nov 15, 2018

@squidfunk

This comment has been minimized.

Copy link
Owner

squidfunk commented Nov 15, 2018

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

This comment has been minimized.

Copy link
Owner

squidfunk commented Nov 17, 2018

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

@squidfunk

This comment has been minimized.

Copy link
Owner

squidfunk commented Nov 17, 2018

Released as part of 3.1.0

@squidfunk squidfunk closed this Nov 17, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment