Additionally, PaletteComponent no longer supports skipsPaletteUpdate or modelChange properties. As GoJS Palettes are read-only by default, their models should not be changing based on user input. Instead, if you need to update their node/link/model data, update their @Input properties (immutably, of course).
Move away as in navigate to a different route within my application. If I navigate back to the diagram component page, I get the error. If I land on that page for the first time, it works fine (so a refresh does work indeed).
My initial palette data is coming from the server and is loaded with that code you are seeing, but I modify it slightly before assigning to draft.paletteNodeData.
I’m not sure here, since it seems like processDesigner.paletteNodes (the object that is apparently read only) is outside the scope of our standard gojs-angular-basic sample, so I’m just shooting in the dark right now…
Have you tried setting color1 and desiredSize outside the produce call?
Have you tried other lifecycle hooks, like ngAfterViewInit?
If you take the service out of the equation and just hard-code some dummy data for paletteNodes, then do the produce call, do you get the same error? If so, the issue may be service-related
Of course I don’t want to do that and I want to keep using data coming from my service. However the following gives me the error mentioned above if land on that page after visiting it already.
It does not make sense to me. Cloning the service data should make it a new object (and it’s not even readonly anyway). It seems the produce method makes it readonly afterwards. But indeed this is likely to be related to immer rather than go-js
Yes, this is likely an issue with the service or immer, neither of which I can claim to be an expert with
It’s certainly outside my area of expertise, but maybe if you send me your service file I can look it over and see if anything stands out. You can do that here or via email if you’re more comfortable with that