GH Canvas::Instantiate New Object() error

Hi all.
I am developing a library, and I have a problem with one user only having this error.

I don’t have any other users facing the same problem.
The tricky part is that I have zero information from the breakpoint; he has no other plug-in installed.
What is even stranger is that the package was working without any errors; he uninstalled it and reinstalled it, and now he always has this error.
Do you have any advice on how I can debug and understand what causes the problem?
I could add some logging, but it fails to add nodes to the canvas, an event I don’t use.
Any help is welcome :slight_smile:
Thanks so much.

You should always add logging, storing it into a file (e.g. within the Local applications folder). I personally use NLog. Why? Because most common errors are related to null states. The nasty part of those is, that you often get issues at different places, without knowing what was going on before. And since you can’t reproduce the issue, a log file is the only source you could make sense of.

From looking at this stack trace, it seems likely that something is strange during initialization of your component or plugin. Something is null. This what the headline tells. The stack trace will show you drag events, but this just tells you that the user probably went to the ribbon and dragged the component.

Without any hints, the best thing you could do is writing unit-tests and find ways to break the initialization.But it’s hard to tell, if it’s related to your plugin at all. What’s also strange about this issue is that it I see no external call.

In case the user patched Grasshopper (by another plugin or on purpose) you and even McNeel will never have a chance to solve the problem. It’s not unlikely that some of the plugins on Food4Rhino do this. Even with removing them, the patch remains.

1 Like