screeps-multimeter icon indicating copy to clipboard operation
screeps-multimeter copied to clipboard

The app fails soon after start

Open Alexey007gold opened this issue 3 years ago • 2 comments

After start it can work a few seconds, and then fail with the following error.

TypeError: Cannot read properties of null (reading 'slice')
    at C:\Users\Alexey\AppData\Roaming\npm\node_modules\screeps-multimeter\node_modules\blessed\lib\program.js:2543:35
    at Array.forEach (<anonymous>)
    at Program._attr (C:\Users\Alexey\AppData\Roaming\npm\node_modules\screeps-multimeter\node_modules\blessed\lib\program.js:2542:11)
    at FastLog.Element._parseTags (C:\Users\Alexey\AppData\Roaming\npm\node_modules\screeps-multimeter\node_modules\blessed\lib\widgets\element.js:498:26)
    at FastLog.Element.parseContent (C:\Users\Alexey\AppData\Roaming\npm\node_modules\screeps-multimeter\node_modules\blessed\lib\widgets\element.js:393:22)
    at FastLog.Element.setContent (C:\Users\Alexey\AppData\Roaming\npm\node_modules\screeps-multimeter\node_modules\blessed\lib\widgets\element.js:335:8)
    at FastLog.Element.insertLine (C:\Users\Alexey\AppData\Roaming\npm\node_modules\screeps-multimeter\node_modules\blessed\lib\widgets\element.js:2383:8)
    at FastLog.Element.pushLine (C:\Users\Alexey\AppData\Roaming\npm\node_modules\screeps-multimeter\node_modules\blessed\lib\widgets\element.js:2526:15)
    at C:\Users\Alexey\AppData\Roaming\npm\node_modules\screeps-multimeter\src\FastLog.js:57:14
    at processTicksAndRejections (node:internal/process/task_queues:78:11)

I'm using logging plugin, my config is like this

servers:
  main:
    host: localhost
    secure: false
    port: "21025"
    username: oleksii
    password: qwerty
configs:
  multimeter:
    plugins: []  
    logFilename: "multimeter.log"

some logs may be added to the file before the crash

Alexey007gold avatar Oct 26 '22 17:10 Alexey007gold

My suspicion is that this is related to HTML code in your log messages. If you open the browser devtools on the screeps web interface you'll see it prints the raw log messages to the console. If you could provide a copy of this up to the point at which it crashes that would be really helpful.

SystemParadox avatar Oct 28 '22 11:10 SystemParadox

I'm logging messages like this

Spawning a creep with body {work,work,move} and cost 250 and role HARVESTER, result: 0

I just tried to find minimal message that makes it fail, and found that it fails for the following message {w,w}, but works for {w} The message {w,w} is still saved to the file, but multimeter crashes right after that

Alexey007gold avatar Oct 31 '22 08:10 Alexey007gold