imyelo / docsify-pagination

↔️ Pagination for docsify
MIT License
108 stars 34 forks source link

Uncaught TypeError causing Sidebar Expansion to Break #35

Open d-marmalade opened 2 years ago

d-marmalade commented 2 years ago

I have a project using docsify, and it seems that the latest release of this plugin is breaking the sidebar expansion functionality.

Problem

When I run the site locally, sidebar expansion does not happen on click, and I encounter the following error in the console:

Uncaught TypeError: Cannot read properties of undefined (reading 'path')
  at k (docsify-pagination.min.js:1:4164)
  at i (docsify-pagination.min.js:1:6048)
  at o (docsify@4:1:107814)
  at o (docsify@4:1:107836)
  at o (docsify@4:1:107836)
  at docsify@4:1:107802
  at docsify-sidebar-collapse.min.js:1:4572
  at o (docsify@4:1:107782)
  at o (docsify@4:1:107836)
  at t.callHook (docsify@4:1:107852)

Workaround

Pinning docsify-pagination to v2.6.x (https://cdn.jsdeliver.net/npm/docsify-pagination@2.6/dist/docsify-pagination.min.js) fixes the issue.

Project State

This project is using:

imyelo commented 2 years ago

Thanks for the feedback. There might be some optional chain protection missing. I just released 2.10.1, but I'm unsure if it's been fixed since I couldn't reproduce the issue. Could you help to confirm?