# Got error while trying to compile a code, tells me to notify devs

**URL:** <https://forum.xod.io/t/got-error-while-trying-to-compile-a-code-tells-me-to-notify-devs/1022>\
**Category:** Uncategorized\
**Created:** [August 7, 2018, 1:22am UTC](https://forum.xod.io/t/got-error-while-trying-to-compile-a-code-tells-me-to-notify-devs/1022 "2018-08-07T01:22:14Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![magic-mallet](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@magic-mallet](https://forum.xod.io/u/magic-mallet)\
**Post date:** [August 7, 2018, 1:22am UTC](https://forum.xod.io/t/got-error-while-trying-to-compile-a-code-tells-me-to-notify-devs/1022/1 "2018-08-07T01:22:14Z")

</div>

Welp, while trying to upload code to an arduino micro, I came across a weird problem. Whenever I try to upload the code, the program window (not the border, like where the minimise and close buttons are) becomes unresponsive. Then, after about 30 seconds or so, I get a it saying Transpiling, followed immediately by a big ol’ red error box saying:

Error  
UNEXPECTED\_ERROR {“message”: “Maximum call stack size exceeded”}  
The error has no formatted, which is a bug. Report the issue to XOD developers.

I’ve tried restarting the computer and program and both yield no different results.

So, here I am like the error message said. I do hope this can be solved soon. I’m excited for this code to work!

I would upload code…but it says I can’t as a new user…

---

<div class="post-metadata">

**Author:** ![nkrkv](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/nkrkv/32/8_2.png) [@nkrkv](https://forum.xod.io/u/nkrkv)\
**Post date:** [August 7, 2018, 8:33am UTC](https://forum.xod.io/t/got-error-while-trying-to-compile-a-code-tells-me-to-notify-devs/1022/2 "2018-08-07T08:33:47Z")

</div>

Hello!

Yes, it’s definitely a bug. What version of XOD do you use? Can you try to attach a xodball of the program that fails again? I think the forum platform will pass it now.

---

<div class="post-metadata">

**Author:** ![magic-mallet](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@magic-mallet](https://forum.xod.io/u/magic-mallet)\
**Post date:** [August 7, 2018, 9:46pm UTC](https://forum.xod.io/t/got-error-while-trying-to-compile-a-code-tells-me-to-notify-devs/1022/3 "2018-08-07T21:46:50Z")

</div>

You got is boss.

I am using version v0.22.0 (2018-07-11)

I actually uninstalled the program and then reinstalled the latest version, and the problem still persisted. I even tried uploading it to a Mega 2560, same problem. I also tried deleting certain segments of the code to see if I can generate a different error message, but nothing.

Anyways, here’s the file: [Kapkan Mine build 0.0.1.xodball](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/72f556c242a2c18cf09b9ba8804eefaabb460df8.xodball) (5.5 KB)

---

<div class="post-metadata">

**Author:** ![evgenykochetkov](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/evgenykochetkov/32/14_2.png) [@evgenykochetkov](https://forum.xod.io/u/evgenykochetkov)\
**Post date:** [August 10, 2018, 9:05am UTC](https://forum.xod.io/t/got-error-while-trying-to-compile-a-code-tells-me-to-notify-devs/1022/4 "2018-08-10T09:05:32Z")

</div>

Hi!  
Could you please also attach a screenshot of how your patch looks?

When I opened it, I got this:

 ![58%20](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/f0d0808ec1c9cc0ae416a24ab89b0a81213775e4.png)  
which is quite weird.

Does this [kapkan-fixed.xodball](https://forum.xod.io/uploads/xod/original/1X/1daf702a40df9351459d555104f858899cb30d72.xodball) (5.0 KB) version work ok?

---

<div class="post-metadata">

**Author:** ![nkrkv](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/nkrkv/32/8_2.png) [@nkrkv](https://forum.xod.io/u/nkrkv)\
**Post date:** [August 10, 2018, 9:13am UTC](https://forum.xod.io/t/got-error-while-trying-to-compile-a-code-tells-me-to-notify-devs/1022/5 "2018-08-10T09:13:15Z")

</div>

@evgenykochetkov I see the same behavior on the latest dev version. But 0.22.0 refuses to open the xodball at all. It shows a gray screen with an error in the console:

```auto
Uncaught TypeError: Cannot read property 'length' of undefined
    at file:///home/nailxx/devel/xod-latest/packages/xod-client-electron/src-babel/bundle.js:11447:49
    at args.(anonymous function) (file:///home/nailxx/devel/xod-latest/packages/xod-client-electron/src-babel/bundle.js:90997:27)
    at _map (file:///home/nailxx/devel/xod-latest/packages/xod-client-electron/src-babel/bundle.js:28829:19)
    at map (file:///home/nailxx/devel/xod-latest/packages/xod-client-electron/src-babel/bundle.js:4199:14)
    at file:///home/nailxx/devel/xod-latest/packages/xod-client-electron/src-babel/bundle.js:2023:15
    at f2 (file:///home/nailxx/devel/xod-latest/packages/xod-client-electron/src-babel/bundle.js:396:16)
    at file:///home/nailxx/devel/xod-latest/packages/xod-client-electron/src-babel/bundle.js:91001:15
    at file:///home/nailxx/devel/xod-latest/packages/xod-client-electron/src-babel/bundle.js:28814:27
    at file:///home/nailxx/devel/xod-latest/packages/xod-client-electron/src-babel/bundle.js:9495:49
    at file:///home/nailxx/devel/xod-latest/packages/xod-client-electron/src-babel/bundle.js:11444:41

```

The crash is in

```auto
var upsertDeadPins = exports.upsertDeadPins = (0, _types.def)('upsertDeadPins :: Node -> Patch -> Map PinKey Pin -> Map PinKey Pin', function (node, currentPatch, pins) {
  var nodeId = Node.getNodeId(node);

  var pinsByDir = R.compose(R.groupBy(Pin.getPinDirection), R.values)(pins);

  var rejectNondeadLinks = R.reject(R.either(R.both(Link.isLinkInputNodeIdEquals(nodeId), R.pipe(Link.getLinkInputPinKey, R.has(R.__, pins))), R.both(Link.isLinkOutputNodeIdEquals(nodeId), R.pipe(Link.getLinkOutputPinKey, R.has(R.__, pins)))));

  return R.compose(R.merge(pins), R.indexBy(Pin.getPinKey), R.unless(R.isEmpty, R.compose(R.map(R.apply(Pin.createDeadPin)), R.unnest, R.values, R.mapObjIndexed(function (group, direction) {
    return (0, _xodFuncTools.mapIndexed)(
    // Adds a correct order as a third element of each Array
    function (data, idx) {
      return R.append(idx + pinsByDir[direction].length, data);
    }, group);
  }), R.groupBy(R.nth(1)), R.map(R.ifElse(Link.isLinkInputNodeIdEquals(nodeId), function (link) {
    return [Link.getLinkInputPinKey(link), CONST.PIN_DIRECTION.INPUT];
  }, function (link) {
    return [Link.getLinkOutputPinKey(link), CONST.PIN_DIRECTION.OUTPUT];
  })))), rejectNondeadLinks, listLinksByNode)(nodeId, currentPatch);
});

```

Looks like it was fixed in [https://github.com/xodio/xod/pull/1399](https://github.com/xodio/xod/pull/1399)

@magic-mallet Do you ever see the same picture? I mean, do you have a red input pin above the constant node? Can you attach a screenshot of what you see on the patch?

---

<div class="post-metadata">

**Author:** ![magic-mallet](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@magic-mallet](https://forum.xod.io/u/magic-mallet)\
**Post date:** [August 11, 2018, 5:30am UTC](https://forum.xod.io/t/got-error-while-trying-to-compile-a-code-tells-me-to-notify-devs/1022/6 "2018-08-11T05:30:53Z")

</div>

Thanks for the speedy Replys peeps. So first off is @evgenykochetkov

That is how it should look. Nasty I know, but I couldn’t think of a way to have the equal compare a reading it just got to the last one it took. Maybe that created some weird loop? And as for the Random Val node, I decided to eventually scrap it and try to work something else out (I want it to activate when it comes back as false.

Unfortunately, it gives me the same error report. I altered the code a small bit to remove some (what I now see as) redundant parts that might be causing issue, but the problem persists. Also, the fixed code you uploaded does not work as well…

And now @nkrkv

Aside from the error message I recieve, I don’t see any other errors or messages. If it helps at all, I’m currently running windows 8.1 (eck). Might that have some negative results on the uploading process in patch 0.22.0?  
Also, here is the screenshot of the current code (with the constant value and an extra ultrasonic sensor signal node removed).

 ![Xod_code_image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/6b7c58e8c4d7bb689cc1c00c02a17a27bef1de25.png)

I honestly don’t know what is causing it, as even using the tutorial code and using a different micro controller, it still doesn’t work.

I thank you both for your help.

---

<div class="post-metadata">

**Author:** ![nkrkv](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/nkrkv/32/8_2.png) [@nkrkv](https://forum.xod.io/u/nkrkv)\
**Post date:** [August 14, 2018, 7:37am UTC](https://forum.xod.io/t/got-error-while-trying-to-compile-a-code-tells-me-to-notify-devs/1022/7 "2018-08-14T07:37:28Z")

</div>

That’s very-very weird. Something really strange happens. The screenshot you’ve posted is very different from what we see when opening the xodball you’ve shared. Notably, I don’t see a `delay` node in your screenshot, however, I see it on ours and it is positioned quite carefully (does not seems like a trash).

I also tried to reproduce the program on your screenshot as is and then hit Deploy → Show code for Arduino. All worked fine.

May I ask you to try to make a blank project and re-build the program node by node, link by link? Do you still get the awkward behavior?

---

<div class="post-metadata">

**Author:** ![magic-mallet](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@magic-mallet](https://forum.xod.io/u/magic-mallet)\
**Post date:** [August 17, 2018, 4:08am UTC](https://forum.xod.io/t/got-error-while-trying-to-compile-a-code-tells-me-to-notify-devs/1022/8 "2018-08-17T04:08:50Z")

</div>

Greetings,

Sorry for the delayed response, Job related stuff and whatnot.

Anyways, I have actually tried to use the tutorial code from a fresh open and install, only to have it fail in the same way. I do however have one idea that might be causing this issue.

Because I don’t really use this laptop for much (since I have my main rig elsewhere), It is not up to date on windows 8.1 updates. Before, I didn’t need to do these updates, as all programs I use in the small time I did use the laptop worked fine. Because of the extreme humidity and thus heat, I have been forced to live in the basement like a troglodyte. I have yet to update the windows 8.1 OS, and since it might be substantially out of date, maybe there is an error where XOD is relying on code or compatibility from a windows update. Could this be an issue?

In any case, I will keep picking at the problem in my spare time and see if I can get anything to happen.  
Thank you for the help you’ve given me, I really do appreciate it.

-Magic Mallet

---

<div class="post-metadata">

**Author:** ![nkrkv](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/nkrkv/32/8_2.png) [@nkrkv](https://forum.xod.io/u/nkrkv)\
**Post date:** [August 17, 2018, 9:02am UTC](https://forum.xod.io/t/got-error-while-trying-to-compile-a-code-tells-me-to-notify-devs/1022/9 "2018-08-17T09:02:33Z")

</div>

I don’t think Windows update state can affect XOD anyhow. Seems like the data is messed somehow. I have no ideas but uninstall XOD, remove directory `C:\Users\<user>\AppData\Roaming\xod-client-electron`, and install again.

By the way, have you tried the [web version of the IDE](https://xod.io/ide/)? Are you getting a correct program there?

---

<div class="post-metadata">

**Author:** ![magic-mallet](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@magic-mallet](https://forum.xod.io/u/magic-mallet)\
**Post date:** [August 19, 2018, 5:57am UTC](https://forum.xod.io/t/got-error-while-trying-to-compile-a-code-tells-me-to-notify-devs/1022/10 "2018-08-19T05:57:31Z")

</div>

Greetings,

So, I have done as you said, and the error persists. At this point, it might be something to do with my machine more than anything, as this is a new install with a new version. Might it also be the micro controller that’s causing the issue? Maybe the program is being corrupted by an old or maybe corrupt itself arduino? At any rate, I have not a clue. I will be away from the 21st to the 24th on vacation. I hope someone finds an answer to this extremely unusual problem.

-Magic Mallet
