Skip to content
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

The app fails soon after start #62

Open
Alexey007gold opened this issue Oct 26, 2022 · 2 comments
Open

The app fails soon after start #62

Alexey007gold opened this issue Oct 26, 2022 · 2 comments

Comments

@Alexey007gold
Copy link

Alexey007gold commented Oct 26, 2022

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

@SystemParadox
Copy link
Collaborator

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.

@Alexey007gold
Copy link
Author

Alexey007gold commented Oct 31, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants