bitburner-official / bitburner-src

Bitburner source code.
Other
753 stars 251 forks source link

TypeError: Cannot read properties of undefined (reading 'length') (at "Terminal") #1478

Closed GoulartNogueira closed 3 weeks ago

GoulartNogueira commented 1 month ago

TypeError: Cannot read properties of undefined (reading 'length') (at "Terminal")

How did this happen?

I had an error and now I cannot open the game. Honestly, I have no idea on what caused this error. I'm just submitting it in case anyone may have a similar issue, so we can prioritize bug fix, or to help identifying the bug, by common patterns.

Environment

Save

RECOVERY_BITBURNER_1720553493.json.gz

GoulartNogueira commented 1 month ago

Update: I restarted the game. Somehow, now it works. Bug is gone. I still have no clue what just happened.

d0sboots commented 1 month ago

I can think of some ways this can happen. If you have a bug in one of your scripts such that you end up redefining one of the fundamental js objects like "String" for instance. We put in protections for String and Object, but there are surely others that are still capable of crashing the game if you set them to undefined. Ah, JavaScript...

d0sboots commented 1 month ago

If it happens again and you can narrow it down to running one of your scripts, please post the script.

HiEv commented 3 weeks ago

This is now a (less detailed) duplicate of bug #1482 "[BUG] Game broke on terminal history search - TypeError: Cannot read properties of undefined (reading 'length') (at "Terminal")".

As such, this issue should probably be closed.

d0sboots commented 3 weeks ago

Good catch. I will close as dupe for now, but it's good to recognize that this has been reported twice (and this probably happened more than twice)