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

Inifinite loop & browser lock up on v5.1.6 #1696

Closed
4 tasks done
bruderstein opened this issue May 15, 2020 · 4 comments
Closed
4 tasks done

Inifinite loop & browser lock up on v5.1.6 #1696

bruderstein opened this issue May 15, 2020 · 4 comments
Labels
bug Issue reports a bug

Comments

@bruderstein
Copy link

bruderstein commented May 15, 2020

I checked that...

  • ... the documentation does not mention anything about my problem
  • ... the problem doesn't occur with the default MkDocs template
  • ... the problem is not in any of my customizations (CSS, JS, template)
  • ... there are no open or closed issues that are related to my problem

Description

The "check for common prefix" method recently added has a bug when both strings are identical - it spins into an infinite loop and locks up.

https://github.com/squidfunk/mkdocs-material/blob/master/src/assets/javascripts/index.ts#L386-L387

In our instance, these two strings are both None and None. I haven't investigated what this method is actually doing.

Browser locks up when visiting the page (if able to break into the code, you can see it gets stuck on this line)

Expected behavior

Should not lock up the browser.

Actual behavior

Locks up.

Steps to reproduce the bug

  1. Clone https://github.com/soundcloud/intervene
  2. Checkout tag v2.8.5, which does not have mkdocs-material pinned to 5.1.5
  3. Ensure mkdocs-material is v5.1.6
  4. Run make mkdocs
  5. Serve the site from the site directory locally
  6. Open the site in the browser, see it lock up (have devtools open, and pause execution to see spinning on that loop)

Package versions

v5.1.6

  • Python: 3.7.6
  • MkDocs: __main__.py, version 1.1 from /usr/local/lib/python3.7/site-packages/mkdocs (Python 3.7)
  • Material: Version: 5.1.6

Project configuration

site_name: intervene
repo_name: intervene
repo_url: https://github.com/soundcloud/intervene

dev_addr: 0.0.0.0:8000

plugins:
  - search

markdown_extensions:
  - admonition
  - codehilite:
      guess_lang: false
  - pymdownx.superfences
  - pymdownx.details
  - toc:
      permalink: 🔗

# ...

theme:
  name: 'material'
  palette:
    primary: 'orange'
    accent: 'deep-purple'
  features:
    - tabs
    - instant

System information

  • OS: macos & linux
  • Browser: chrome & firefox
@squidfunk
Copy link
Owner

Perfect! That sounds like the root cause of #1690! Should be easy to fix. Would you like to take on a PR?

@squidfunk squidfunk added the bug Issue reports a bug label May 15, 2020
@bruderstein
Copy link
Author

Raised #1697

@squidfunk
Copy link
Owner

I went ahead and added the short-circuit solution. The error should be gone now. I'll issue a new release shortly.

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label May 16, 2020
@squidfunk squidfunk reopened this May 16, 2020
@squidfunk
Copy link
Owner

Released as part of 5.1.7 – give it a try and if the issue persists, reopen. Also added SoundCloud to the list of companies in the README - pretty psyched that you like it, cause I love SoundCloud 😉

@squidfunk squidfunk removed the resolved Issue is resolved, yet unreleased if open label May 16, 2020
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

Successfully merging a pull request may close this issue.

2 participants