-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Deserialization isn't working properly #997
Comments
Hey you just swapped name and id in the constructor of your Port. Since the name of the port is used as an index in
So essentially only add 1, all further are overwritten, since you use "true" as name. And now the big BUT:
relies on Bottom line: Now you know WHY it fails a fix four your issue will be to just swap the parameters in the constructor of your ports. But: Because even if your issue can easily be fixed it shows a major weakness (at least in my eyes) of how ports are handled in NodeModel |
I've followed the example serialization code, and serialization works, but when I try to deserialize, if more than 2 ports are added, it just returns:
Uncaught TypeError: Cannot read porperties of null (reading 'getID') at DefaultNodeModel.ts:114:17
I'm not using any custom nodes or links, etc just DefaultNodeModel.
Stack:
React 18.2 + Vite 4.1 + Electron 23.2
Serialization
Deserializaton
Adding ports
I am also saving and opening the data to a JSON file
Saving
Opening
The text was updated successfully, but these errors were encountered: