copilot-cli icon indicating copy to clipboard operation
copilot-cli copied to clipboard

ERROR Maximum call stack size exceeded

Open SkybuckFlying opened this issue 2 months ago • 2 comments

Describe the bug

 ✓ Edit S:/GitHubRepos/WebCombatUltraCoPilot/utils/audio.ts (+5 -2)
   ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
   │ 259   const now = this.audioContext!.currentTime;                                                                                    │
   │ 260                                                                                                                                  │
   │ 261   const panner = this.createPanner(event.position);                                                                              │
   │ 262 - panner.connect(this.compressor!);                                                                                              │
   │ 262 + const limiter = this.audioContext!.createGain();                                                                               │
   │ 263 + limiter.gain.value = 0.8; // protect headroom for loops                                                                        │
   │ 264 + const panner = this.createPanner(event.position);                                                                              │
   │ 265 + limiter.connect(this.compressor!);                                                                                             │
   │ 266                                                                                                                                  │
   │ 267   const gain = this.audioContext!.createGain();                                                                                  │
   │ 268   gain.gain.setValueAtTime(0, now);                                                                                              │
   │ 269   gain.gain.linearRampToValueAtTime(1.0, now + 0.1); // Fade in                                                                  │
   │ 267 - gain.connect(panner);                                                                                                          │
   │ 270 + gain.connect(panner).connect(limiter)                                                                                          │
   │ 271                                                                                                                                  │
   │ 272   let source: AudioNode;                                                                                                         │
   │ 273   let filter: BiquadFilterNode | undefined;                                                                                      │
   ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

 ✓ Edit S:/GitHubRepos/WebCombatUltraCoPilot/utils/audio.ts (+6 -1)
   ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
   │ 283   filter.frequency.value = 800;                                                                                                  │
   │ 284   filter.Q.value = 5;                                                                                                            │
   │ 285                                                                                                                                  │
   │ 286 - gain.gain.value = 0.4;                                                                                                         │
   │ 286 + // Distance-based gain scaling for loops                                                                                       │
   │ 287 + const dx = event.position.x - this.listenerPosition.x;                                                                         │
   │ 288 + const dy = event.position.y - this.listenerPosition.y;                                                                         │
   │ 289 + const dist = Math.hypot(dx, dy);                                                                                               │
   │ 290 + const distGain = 1 / (1 + (dist / 600));                                                                                       │
   │ 291 + gain.gain.value = 0.35 * distGain;                                                                                             │
   │ 292   noiseSource.connect(filter).connect(gain);                                                                                     │
   │ 293   source = noiseSource;                                                                                                          │
   │ 294   break;                                                                                                                         │
   ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯



  ERROR  Maximum call stack size exceeded

 file:///G:/Tools/npm-global/node_modules/@github/copilot/index.js:1956:3778

 -  (file:///G:/Tools/npm-global/node_modules/@github/copilot/index.js:1956:3778)
 - P1 (file:///G:/Tools/npm-global/node_modules/@github/copilot/index.js:138:14134)
 - Object.useMemo (file:///G:/Tools/npm-global/node_modules/@github/copilot/index.js:228:2575)
 - process.env.NODE_ENV.kr.useMemo (file:///G:/Tools/npm-global/node_modules/@github/copilot/index.js:47:12100)
 - mlI (file:///G:/Tools/npm-global/node_modules/@github/copilot/index.js:1956:3754)
 - react-stack-bottom-frame (file:///G:/Tools/npm-global/node_modules/@github/copilot/index.js:228:12764)
 - rR (file:///G:/Tools/npm-global/node_modules/@github/copilot/index.js:138:807)
 - tV (file:///G:/Tools/npm-global/node_modules/@github/copilot/index.js:145:18033)
 - nW (file:///G:/Tools/npm-global/node_modules/@github/copilot/index.js:145:16222)
 - eV (file:///G:/Tools/npm-global/node_modules/@github/copilot/index.js:145:15753)

Affected version

CLI Version 0.0.335

Steps to reproduce the behavior

No response

Expected behavior

No errors, plenty of stack size ?

Additional context

No response

SkybuckFlying avatar Oct 23 '25 18:10 SkybuckFlying

More information what might have caused this copilot error:

When running with npm run dev:

[plugin:vite:esbuild] Transform failed with 1 error:
S:/GitHubRepos/WebCombatUltraCoPilot/utils/audio.ts:264:14: ERROR: The symbol "panner" has already been declared

S:/GitHubRepos/WebCombatUltraCoPilot/utils/audio.ts:264:14

The symbol "panner" has already been declared
262|          const limiter = this.audioContext!.createGain();
263|          limiter.gain.value = 0.8; // protect headroom for loops
264|          const panner = this.createPanner(event.position);
   |                ^
265|          limiter.connect(this.compressor!);
266|

    at failureErrorWithLog (S:\GitHubRepos\WebCombatUltraCoPilot\node_modules\esbuild\lib\main.js:1467:15)
    at S:\GitHubRepos\WebCombatUltraCoPilot\node_modules\esbuild\lib\main.js:736:50
    at responseCallbacks.<computed> (S:\GitHubRepos\WebCombatUltraCoPilot\node_modules\esbuild\lib\main.js:603:9)
    at handleIncomingPacket (S:\GitHubRepos\WebCombatUltraCoPilot\node_modules\esbuild\lib\main.js:658:12)
    at Socket.readFromStdout (S:\GitHubRepos\WebCombatUltraCoPilot\node_modules\esbuild\lib\main.js:581:7)
    at Socket.emit (node:events:524:28)
    at addChunk (node:internal/streams/readable:561:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
    at Readable.push (node:internal/streams/readable:392:5)
    at Pipe.onStreamRead (node:internal/stream_base_commons:189:23

Click outside, press Esc key, or fix the code to dismiss.
You can also disable this overlay by setting server.hmr.overlay to false in vite.config.ts.

SkybuckFlying avatar Oct 23 '25 18:10 SkybuckFlying

That version is quite old, could you try the latest one and see if you can still reproduce this issue?

npm i -g @github/copilot@latest should do the trick

Thank you!

sergiou87 avatar Oct 24 '25 13:10 sergiou87