logseq / logseq

A privacy-first, open-source platform for knowledge management and collaboration. Download link: http://github.com/logseq/logseq/releases. roadmap: http://trello.com/b/8txSM12G/roadmap
https://logseq.com
GNU Affero General Public License v3.0
30.7k stars 1.78k forks source link

Crash when searching - Error caught by UI! TypeError: Cannot read properties of null (reading 'toLowerCase') #8948

Open rp606 opened 1 year ago

rp606 commented 1 year ago

Search first

What Happened?

Every time I attempt to search, Logseq crashes and gives the error message "Error caught by UI! TypeError: Cannot read properties of null (reading 'toLowerCase')"

I have tried all 3 suggested solution steps: re-build search index, relaunch app, clear local storage. None of them helped.

This happens both when signed in and syncing the graph, but also when signed out and with the sync feature off.

Reproduce the Bug

  1. Open search dialogue (clicking on the magnifying glass or pressing CTRL + K)
  2. Enter any search string
  3. Crash

Expected Behavior

No response

Screenshots

2023-03-29 11_32_59-Logseq

Desktop or Mobile Platform Information

I am on Windows 10 running Logseq version 0.9, but this happened with the previous 2 versions as well.

Additional Context

No response

Are you willing to submit a PR? If you know how to fix the bug.

cnrpman commented 1 year ago

What's the page name or content triggering the error? Can you narrow it down?

rp606 commented 1 year ago

Thanks for your response and for looking at this!

How can I better narrow it down?

I have tried starting to search from different pages as well as the journal page & also tried different search strings - the error always happens.

cnrpman commented 1 year ago

@rp606 Maybe you can:

  1. Provide the console output on error happens: https://help.figma.com/hc/en-us/articles/360041949073-Use-Chrome-Developer-Tools

  2. For narrowing down the issue:

      1. Create a new graph and check if the issue exists;
      1. Copy some of your pages to the new graph and check if the issue exists
    • Repeat the step 2 for narrowing
odysseus90210 commented 1 year ago

How does one rebuild the search index if the crash occurs immediately upon launch?

cnrpman commented 1 year ago

@odysseus90210 May delete the cache files directly: https://discuss.logseq.com/t/how-to-clear-cache-in-logseq/13693#on-a-mac-3

NazzarenoGiannelli commented 5 months ago

In my case the error was highlighting also a specific whiteboard file that was causing the issue. Inspecting the code of that specific file I was able to identify the faulty section, remove it and make the whiteboard behave normally again.

It's probably not your same exact case, but it might be helpful for someone else to know.

Screenshot 2024-01-26 220806