How to fix Maximum call stack size exceeded?

root ERROR RangeError: Maximum call stack size exceeded
    at Array.i (https://dev.srdcloud.cn/ide/4fd999af-1ae8-4c76-9390-65c6836564c6/bundle.js:2:10546197)
    at x (https://dev.srdcloud.cn/ide/4fd999af-1ae8-4c76-9390-65c6836564c6/bundle.js:2:10543667)
    at Array.eval [as read] (eval at i (https://dev.srdcloud.cn/ide/4fd999af-1ae8-4c76-9390-65c6836564c6/bundle.js:2:10546027), <anonymous>:3:32)
    at x (https://dev.srdcloud.cn/ide/4fd999af-1ae8-4c76-9390-65c6836564c6/bundle.js:2:10543667)
    at Array.eval [as read] (eval at i (https://dev.srdcloud.cn/ide/4fd999af-1ae8-4c76-9390-65c6836564c6/bundle.js:2:10546027), <anonymous>:3:32)
    at x (https://dev.srdcloud.cn/ide/4fd999af-1ae8-4c76-9390-65c6836564c6/bundle.js:2:10543667)
    at Array.eval [as read] (eval at i (https://dev.srdcloud.cn/ide/4fd999af-1ae8-4c76-9390-65c6836564c6/bundle.js:2:10546027), <anonymous>:3:35)
    at x (https://dev.srdcloud.cn/ide/4fd999af-1ae8-4c76-9390-65c6836564c6/bundle.js:2:10543667)
    at Array.eval [as read] (eval at i (https://dev.srdcloud.cn/ide/4fd999af-1ae8-4c76-9390-65c6836564c6/bundle.js:2:10546027), <anonymous>:3:45)
    at x (https://dev.srdcloud.cn/ide/4fd999af-1ae8-4c76-9390-65c6836564c6/bundle.js:2:10543667)

@wenqi thank you for the discussion, unfortunately there is not enough information or details in your post to identify where the problem is. The maximum call stack size exceeded error is most likely caused by recursion where a base condition is not met, you’ll need to debug and identify where this problem exists.

This is the error generated on the server, I find it hard to debug, I give detailed information,

when executed

public onStart(): void {
    if (nls.locale) return
    this.messageService.info('srdcloudIDE 目前已支持中文,是否切换?', {},  'Restart', 'Ignore').then(async (val) => {
      if (val === 'Restart') {
        this.windowService.setSafeToShutDown();
        window.localStorage.setItem(nls.localeId, 'zh-cn');
        this.windowService.reload();
      }
    })
  }
bundle.js:formatted:45731 2022-09-13T02:41:04.195Z root ERROR RangeError: Maximum call stack size exceeded
    at Array.eval [as read] (eval at i (https://test.srdcloud.cn/ide/ebac6736-37ee-4cf2-85de-46138975f0fb/bundle.js:2:10546400), <anonymous>:3:19)
    at x (https://test.srdcloud.cn/ide/ebac6736-37ee-4cf2-85de-46138975f0fb/bundle.js:2:10544040)
    at Array.eval [as read] (eval at i (https://test.srdcloud.cn/ide/ebac6736-37ee-4cf2-85de-46138975f0fb/bundle.js:2:10546400), <anonymous>:3:48)
    at x (https://test.srdcloud.cn/ide/ebac6736-37ee-4cf2-85de-46138975f0fb/bundle.js:2:10544040)
    at Array.eval [as read] (eval at i (https://test.srdcloud.cn/ide/ebac6736-37ee-4cf2-85de-46138975f0fb/bundle.js:2:10546400), <anonymous>:3:32)
    at x (https://test.srdcloud.cn/ide/ebac6736-37ee-4cf2-85de-46138975f0fb/bundle.js:2:10544040)
    at Array.eval [as read] (eval at i (https://test.srdcloud.cn/ide/ebac6736-37ee-4cf2-85de-46138975f0fb/bundle.js:2:10546400), <anonymous>:3:32)
    at x (https://test.srdcloud.cn/ide/ebac6736-37ee-4cf2-85de-46138975f0fb/bundle.js:2:10544040)
    at Array.eval [as read] (eval at i (https://test.srdcloud.cn/ide/ebac6736-37ee-4cf2-85de-46138975f0fb/bundle.js:2:10546400), <anonymous>:3:35)
    at x (https://test.srdcloud.cn/ide/ebac6736-37ee-4cf2-85de-46138975f0fb/bundle.js:2:10544040)
e.log @ bundle.js:formatted:45731
(anonymous) @ bundle.js:formatted:27944
(anonymous) @ bundle.js:formatted:45889
(anonymous) @ bundle.js:formatted:45884
Promise.then (async)
log @ bundle.js:formatted:45883
i @ bundle.js:formatted:45826
invoke @ bundle.js:formatted:44123
fire @ bundle.js:formatted:44200
handleData @ bundle.js:formatted:46686
handleMessage @ bundle.js:formatted:46648
(anonymous) @ bundle.js:formatted:46612
(anonymous) @ bundle.js:formatted:44115
invoke @ bundle.js:formatted:44121
fire @ bundle.js:formatted:44200
(anonymous) @ bundle.js:formatted:47569
(anonymous) @ bundle.js:formatted:28648
i.emit @ bundle.js:formatted:16214
emitEvent @ bundle.js:formatted:357389
onevent @ bundle.js:formatted:357381
onpacket @ bundle.js:formatted:357360
i.emit @ bundle.js:formatted:16214
ondecoded @ bundle.js:formatted:357114
i.emit @ bundle.js:formatted:16214
add @ bundle.js:formatted:357644
ondata @ bundle.js:formatted:357111
i.emit @ bundle.js:formatted:16214
onPacket @ bundle.js:formatted:356047
i.emit @ bundle.js:formatted:16214
onPacket @ bundle.js:formatted:356221
onData @ bundle.js:formatted:356218
ws.onmessage @ bundle.js:formatted:356600

@wenqi I believe it has already been fixed thanks to Disable `bundleStrings` RPC extension by msujew · Pull Request #11636 · eclipse-theia/theia · GitHub. It will make it to the release at the end of the month, or you can think about using a next version of the framework in the meantime.

@wenqi Please use this export NODE_OPTIONS=–max_old_space_size=4096 to increase the heap space to fix this issue