8000 Inifinite loop & browser lock up on v5.1.6 · Issue #1696 · squidfunk/mkdocs-material · GitHub
[go: up one dir, main page]

Skip to content

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

@bruderstein

Description

@bruderstein

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue reports a bug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0