# Grasshopper canvas bug

**URL:** <https://discourse.mcneel.com/t/grasshopper-canvas-bug/182818>\
**Category:** Grasshopper\
**Tags:** windows, bug, gui\
**Created:** [May 27, 2024, 3:19am UTC](https://discourse.mcneel.com/t/grasshopper-canvas-bug/182818 "2024-05-27T03:19:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hzamani](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/hzamani/32/709130_2.png) [@hzamani](https://discourse.mcneel.com/u/hzamani)\
**Post date:** [May 27, 2024, 3:19am UTC](https://discourse.mcneel.com/t/grasshopper-canvas-bug/182818/1 "2024-05-27T03:19:25Z")

</div>

Does anyone have a clue why this is happening and how to fix it?  
My component is outputting a json text.

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/1/2/2/1229d808aa81683ddac2f03e0239338bdc54b4a2.png)

If I write click on the panel, I can copy data. Also if I zoom in and out on the canvas the components appear but the text is not showing inside the panel.

![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/6/7/f/67f828423e3888a17be845054cf02d33c1d9fcd0.png)

![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/4/f/7/4f78ecaea8004477424b6b471921d4688c49fd6d.png)

This also happens trying to add a new panel.

![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/c/6/2/c62bff3ac602d9c34433dc11693264612a30b0da.png)

---

<div class="post-metadata">

**Author:** ![TomTom](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/tomtom/32/651939_2.png) [@TomTom](https://discourse.mcneel.com/u/TomTom)\
**Post date:** [May 27, 2024, 4:08am UTC](https://discourse.mcneel.com/t/grasshopper-canvas-bug/182818/2 "2024-05-27T04:08:41Z")

</div>

Never seen such a bug, but its suspicious that it happens in between plugin components with a custom data type passed around. Could you post your RH/GH version and the name of the plugin?

---

<div class="post-metadata">

**Author:** ![hzamani](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/hzamani/32/709130_2.png) [@hzamani](https://discourse.mcneel.com/u/hzamani)\
**Post date:** [May 27, 2024, 4:53am UTC](https://discourse.mcneel.com/t/grasshopper-canvas-bug/182818/3 "2024-05-27T04:53:34Z")

</div>

Hi Tom,

It’s custom plugin that we have developed internally. What it does under the hood is turning a custom object to json using Newtonsoft and custom converter. Then it just outputs the json as a text.

Update: The issue seems to have gone away atm. What I’ve done was I added [JsonIgnore] to some properties of the object being converted to json! not sure if that’s playing a role but it looks like it’s working now!

---

<div class="post-metadata">

**Author:** ![TomTom](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/tomtom/32/651939_2.png) [@TomTom](https://discourse.mcneel.com/u/TomTom)\
**Post date:** [May 27, 2024, 5:19am UTC](https://discourse.mcneel.com/t/grasshopper-canvas-bug/182818/4 "2024-05-27T05:19:07Z")

</div>

> [@hzamani](#):
>
> What I’ve done was I added [JsonIgnore] to some properties of the object being converted to json! not sure if that’s playing a role but it looks like it’s working now!

Note two things. If your plugin causes an exception, maybe because of unsupported implicit type conversion within text parameter component, you may cause this behaviour as an indirect consequence. Other than that, always be aware that if you pass custom types around, you might introduce problems because you are passing data as reference. You need to ensure that data is deeply copied in places required. Nested data, typical for json data, you might only copy shallow here. In any case, if something is failing, its more a symptom. A good way to debug this is using an debugger like DNSpy which is capable in decompiling all the code involved. You could set a breakpoint within the text parameter component and see why its causing this behaviour underneath.

---

<div class="post-metadata">

**Author:** ![hzamani](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/hzamani/32/709130_2.png) [@hzamani](https://discourse.mcneel.com/u/hzamani)\
**Post date:** [May 27, 2024, 5:26am UTC](https://discourse.mcneel.com/t/grasshopper-canvas-bug/182818/5 "2024-05-27T05:26:18Z")

</div>

Thanks for the tips but the component is running with no exception and it’s not passing any custom object with reference. It’s text in text out.

---

<div class="post-metadata">

**Author:** ![TomTom](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/tomtom/32/651939_2.png) [@TomTom](https://discourse.mcneel.com/u/TomTom)\
**Post date:** [May 27, 2024, 5:43am UTC](https://discourse.mcneel.com/t/grasshopper-canvas-bug/182818/6 "2024-05-27T05:43:14Z")

</div>

okay, then it might came from a failing conversion, delegating the error upstream. Maybe it came into null state. Again in custom components strings are passed as reference and are not copied like in Script components. I would try **to not ignore that** and see in how you can provoke this bug. Conversions could fail in many scenario’s. And in such a case, it should not break the canvas then. In case you ever release such an plugin, you’ll introduce bugs people might not immediately associate with your plugin.
