Skip to content

Hidden sidebar causing other plugins issues #1392

Description

@markbattistella

Bug Report

Steps to reproduce

  1. Setup fresh site
  2. Add config:
    window.$docsify={name: '',repo: '',// cover page doccoverpage: true,homepage: 'home.md',// remove sidebarhideSidebar: true,// auto scroll to topauto2top: true}
  3. Create two or more md pages:
    1. home.md -- add 2x href to page1 and page2
    2. page1.md -- add 2x href to home and page2
    3. page2.md -- add 2x href to home and page1
  4. Launch http://localhost:3000
  5. From /#/home in console no errors
    1. Click on page1 link
    2. Continue to cycle through pages without hard refresh

What is current behaviour

After first load and the sidebar is removed, any other navigation to other pages triggers the .remove which fails since the element is already gone.

If the error is hit, then following plugins dont run until a hard reload.

Uncaught TypeError: Cannotreadproperty'remove'ofnullatVn.Xn._renderSidebar(docsify.min.js:1)atVn.Pn(docsify.min.js:1)atdocsify.min.js:1ato(docsify.min.js:1)atB(docsify.min.js:1)att(docsify.min.js:1)atdocsify.min.js:1atdocsify.min.js:1atdocsify.min.js:1atOn(docsify.min.js:1)
Line4150: returndocument.querySelector("aside.sidebar").remove(),

What is the expected behaviour

Error doesn't occur, and doesn't stop other scripts from running.

Other relevant information

  • Bug does still occur when all/other plugins are disabled?

  • Your OS: macOS

  • Node.js version: 14.8.0

  • npm/yarn version: 6.14.8

  • Browser version:

  • Docsify version: 4.11.6

  • Docsify plugins:

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugconfirmed as a bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions