lezer-parser / highlight

Syntax highlighting from Lezer trees
MIT License
30 stars 9 forks source link

highlight crashes upon trying to iterate over a list of tags, "undefined" #12

Closed onepremise closed 6 months ago

onepremise commented 6 months ago

While using this great plugin for codemirror, I encountered a case where tags is being assigned "undefined". This results in the plugin crashing our editor. I was hoping we could get this fix pushed in for the next release. Please let me know if you think I'm missing anything that may result in this error. However, it still might be wise to account for "undefined" before iterating through the expected list. Thanks for all your contributions and we get a lot of great use out of your tools!!

image

marijnh commented 6 months ago

The types forbid this function from being called with undefined, so the problem is elsewhere. Do you have a (simple) example script that triggers this error?

onepremise commented 6 months ago

After further evaluation and digging, we were able to locate the actual source. There was a themed plugin we were using, react-theming/storybook-addon, that was pretty old. Once we updated the dependency, the patch was no longer required. We can close this.