-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
[BLOCKING] Browser crash everytime when using the searchbar from an anchorlink #1670
Comments
I tested on Chrome macOS latest release. On your book the browser stops responding on the tab. On https://toolchain.gitbook.com/setup.html I can select a topic, and then type Is your book public @etiennedesign ? My first guess is that it would be an incompatibility with lunr and one of the plug-ins. I did have issues with this when using the |
@jaredmorgs The issue occurs when the summary entry points to an anchor inside the article (for example: https://toolchain.gitbook.com/syntax/markdown.html#emphasis). @etiennedesign I tested a bit, and the behavior is really odd: if you click on the summary entry, it scrolls into the chapter, to the appropriate heading. That could be the problem. If you click on the summary entry and scroll up to the top, you can search then without freezing. @SamyPesse @Soreine any ideas? |
Thanks for your replies. @jaredmorgs i made you collaborator so you can see, i don't think it is due to my configuration or plugins because i tested it on several books with default plugin and it freeze. A dev friend told me it seems to be a memory leak, like a process which multiply infinitely, a loop or something.. maybe the function which take each letter to refine the search.. @nagim exactly, if i look in the url browser bar, when i scroll to the top it works because i have https://toolchain.gitbook.com/syntax/markdown.html , as soon as i have #something anchor at the end it freeze when i type in the searchbar. |
I've taken a closer look at your second comment when you are testing it on the Toolchain docs. And I can replicate the bug: Test 1Procedure
Actual Resultslunr search stops responding and the browser tab crashes. Test 2Procedure
Actual ResultsYou get a "No results matching ted" message but the browser still stops responding. Other observationsNaked .md link in https://toolchain.gitbook.com/plugins/hooks.html on the text string "It is recommended using templating to extend page parsing." |
After testing with the plugin you sent me (search-plus), the same issue occur. I also noticed that when you add internal links inside a page then click on it, the searchbar is working properly. Is there a way to remove this animation? |
Yes, it must be the scrolling mechanism. @SamyPesse this issue is quite serious, basically you cannot use search if you have scrolled down in a page, because it crashes instantly. |
+1 |
@nagim i am pretty sure this issue is due to the scroll-linked positionning effect. this is the message i get from the Mozilla console:
Do you know a way i could desactivate this function in the theme.js ? It would be a temporary solution. |
A quick update to this thread to let you know that I was debugging this issue this afternoon, in order to backport a fix and do a The issue seems to be an infinite loop (in some scenarios) in the event handler that scrolls to the appropriate part of the page when the URL changes. Specifically the issue seems to be here: The stop condition of that loop isn't very strict ... |
I have a local fix working, will try and get this out in a |
That's great news, @AaronO! While you're at it, can you investigate this as well: if I open a link from outside the book (e.g.: from email) pointing to a section/anchor in a page, it doesn't jump to the right place. Thanks in advance! |
@nagim Can you report this another bug, because it seems to work on our official docs: https://toolchain.gitbook.com/syntax/markdown.html#emphasis (built with I'm gonna keep this release focused on fixing the key issue here. |
Will do, thanks! |
Everyone, this is fixed the newly minted |
This fix is live on |
Thank you! This has been my no. 1 issue for ages. Love your work. |
If you search while viewing a page at an HTML anchor/fragment, it causes a JS error that makes the tab/browser spin out of control. GitbookIO/gitbook#1670
This reverts commit fc46dab.
* master: (145 commits) Bump version to 3.2.3 Update theme-default to 1.0.7 (fixes GitbookIO#1670) Bump version to 3.2.2 Rollback to use gitbook-markdown@1.3.2 Correctly handle page parsing errors Add comment Add changes for 3.2.1 Bump version to 3.2.1 Update theme-default@1.0.6 Use nunjucks@2.5.2 fixing a typo of the word "publishing" (GitbookIO#1536) Update examples.md (GitbookIO#1522) Fixed typo Fix command for getting gitbook version Create template for GitHub issues Add OSX testing on Travis Bump version to 3.2.0 Update theme-default@1.0.5 Fix GitbookIO#1408: fix i18n in website generator and add tests for it editPlugin and getPluginConfig ...
I met a critical issue.
Reproduction steps:
1 - Go to https://etiennedesign.gitbooks.io/test-gitbook-3/content/
2 - Click on a link on the sidebar
3 - Type in the searchbar
4 - The browser crash due to javascript error
Things i tried:
"maxIndexSize": 2000000,
to lunr configurationMozilla error message:
The text was updated successfully, but these errors were encountered: