citizenfx / fivem-docs

FiveM documentation repository
https://docs.fivem.net/
98 stars 298 forks source link

Application Crash on Single Character Search #489

Open colistro123 opened 1 week ago

colistro123 commented 1 week ago

Description

Typing single characters into the search bar such as 'd', 'b', 't', 'y', i', 'p', or 'c' causes the application to crash with the following exception:

framework-bb5c596eafb42b22.js:1  TypeError: Cannot read properties of undefined (reading '_index')
    at s.Index.query (487-fa5e521920c20672.js:1:43662)
    at 866-f4055ad1abfad8d2.js:1:7281
    at 162-b0a12650f642b97f.js:1:27716
    at 162-b0a12650f642b97f.js:1:27331
    at Ye (e82996df-2860872e62a5626f.js:1:17280)
    at t.track (e82996df-2860872e62a5626f.js:1:21616)
    at E (162-b0a12650f642b97f.js:1:27307)
    at s (162-b0a12650f642b97f.js:1:27695)
    at oo (framework-bb5c596eafb42b22.js:1:59416)
    at Wo (framework-bb5c596eafb42b22.js:1:68983)

Steps to reproduce

  1. Go to docs.fivem.net.
  2. Type 'd' (or any other character mentioned above) into the search bar.
  3. See error in the browser's developer console.

Expected behavior

The results should be mapped and displayed in the end-user's navigation menu.

AvarianKnight commented 1 week ago

This is caused by lunr.js index's getting corrupted (from what I'm assuming is the static files not getting updated).

colistro123 commented 1 week ago

This is caused by lunr.js index's getting corrupted (from what I'm assuming is the static files not getting updated).

Yeah, I also believe this is an issue related to the lunr.js node package; I have a hunch it's happening during page load. I would try to replicate this by running it locally with an exact copy of what's on the server and actually using source maps for easier debugging, since it's difficult to debug when using minified js files, especially in production builds.

Chrome and Firefox are also able to load source maps.

Ideally I would also run it on Visual Studio code using NodeJS debug launch configuration so the typescript files can be debugged line by line.

You have a great weekend nonetheless 😊