fix: Cannot read properties of undefined (reading 'length') #13
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hello,
It seems like
this.modules[j++].ruleson line 122 of style.mod.js can be undefined sometimes. At least it happened here when I am using Codemirror that is inside plugin-split-editing of milkdown.Anyway. It should be protected to deal with such case.
This PR is a proposed fix.
Let me know if it can be merged soon and a new version tagged and released. thanks.
If there's a bug that causes that array to be maintained incorrectly, I'll want to diagnose the bug rather than paper it over with a null check. Can you set up a minimal script that triggers this error?
You are right.
I just didn't have time to read more of your code and to find out why it is reaching such condition.
And for the reproducible test, I cannot easily give you something as it is not from my code.
As I said, there is a CodeMirror inside this plugin of milkdown and the error comes when I am using it, with the default setup they propose.
If you want you can have a look at how I am invoking it, in a svelte project here
For this bug I have less time to dedicate unfortunately, but once you have a fix, let me know, and I'll gladly test it.
I can just add that with the proposed fix, CodeMirror seems to be happy and everything works fine.
The problem is this code passing something that's not an actual
StyleModuleinstance toEditorView.styleModule.of.Yes, I have seen that code today and wondered if it was good or not.
I will talk with the developers of the plugin.
Thanks for looking into it!
Pull request closed