codemirror-vim icon indicating copy to clipboard operation
codemirror-vim copied to clipboard

Null access error throw with command in keydown handler

Open sergeichestakov opened this issue 2 years ago • 3 comments

looks like command can be null here in some rare cases so CM Vim will throw an error when we try to access it's types as part of the keydown handler. Seems to be a more recent regression. Not sure if this is something we should be checking for.

Hard to get an exact repro but here's a screenshot of the stack trace we've seen in the wild:

Screenshot 2023-03-03 at 11 37 34 AM

sergeichestakov avatar Mar 03 '23 16:03 sergeichestakov

@nightwing can you take a look please?

sergeichestakov avatar Mar 16 '23 22:03 sergeichestakov

I have tried to track this down but without much success unfortunately. I'll try to add types to vim.js maybe it will help to track down the issue.

Alternatively i can try to add more info to the error log, it might help, if the error happens often on replit.

nightwing avatar Mar 17 '23 19:03 nightwing

Gotcha yeah this is happening pretty infrequently. We just saw it in our logs. Perhaps we can bail if command is undefined? Although not sure myself how that would happen.

Also, it would be great to type vim.js but we can tackle that separately.

sergeichestakov avatar Mar 18 '23 17:03 sergeichestakov

should be fixed by https://github.com/replit/codemirror-vim/pull/205

nightwing avatar Mar 26 '25 14:03 nightwing