binaryage/dirac

Many Dirac errors since 1.1.3

tylerperkins opened this issue · 6 comments

For example, I was stopped at a breakpoint, went to the Console, and saw this:

Error: Failed to execute 'setStart' on 'Range': There is no child at offset 20.
at Console.DiracPromptWithHistory.onKeyDown (chrome-extension://kbkdngfljkchidcjpnfcgcokkbhlkogi/devtools/front_end/console/console_module.js:129:146)

I just briefly looked at the code and it could be a bug related to going to previous item in prompt history (up arrow) which had multiple lines.

But it might be something else because I just tried to reproduce it here and it works for me.

Can you share your Chrome version and platform?

Yes, the error message appears whenever I press the Up-Arrow key. I've seen it in these two versions of Chrome Canary for MacOS:

  • 58.0.3004.3
  • 58.0.3005.2 (the current version)

By the way, I really want to thank you for your great work. Dirac DevTools is a fantastic tool, and I'm sure it will only get better.

Just wondering if you could try to start with a clean chrome profile (without REPL prompt history) and try to reproduce it again. And if the bug is still present, please share steps you did. I'd like to reproduce it somehow.

That seems to have fixed it! I quit Chrome, removed directory .dirac-chrome-profile, started Chrome, installed Dirac, ran my app, and there are no Dirac errors now. Thanks!

It looks to me that the code got confused by your REPL history. Recorded textual representation had 20+ lines but actual rendered DOM contained less child elements due to some reason. And the particular code trying to select/manipulate the DOM expected single child element per line and indexed out-of-bounds.

The reason why rendered DOM had fewer lines could be related to parinfer ignoring empty lines. This probably happened because you copy&pasted some code snippet into Dirac prompt.

Yes, I had been pasting multi-line commands into the Console. Just now tried pasting a two-line (def ...), then Up-Arrow. Now I see the error again.