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


#1

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…


#2

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.


#3

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 (5.5 KB)


#4

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

When I opened it, I got this:


which is quite weird.

Does this kapkan-fixed.xodball (5.0 KB) version work ok?


#5

@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:

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

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

@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?


#6

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).

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.


#7

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?