April 7, 2026
Promises, promises… cue the flamewar
You can't cancel a JavaScript promise (except sometimes you can)
Dev feud erupts over the “freeze it” trick—GC vs generators vs C# vibes
TLDR: The article says you still can’t cancel a JavaScript promise, but some tools “freeze” functions with a never-ending wait or use generators to pause cleanly. Comments split between generator superfans, C# token advocates, and GC skeptics, with others urging practical AbortController use—big stakes for long-running tasks and cloud timeouts.
JavaScript devs are fighting over how to say “stop” when code keeps going. The article says you can’t cancel a Promise (those little “I’ll do it later” tasks), but you can pull a weird move: wait on a Promise that never finishes and let the garbage collector—the language’s cleanup robot—quietly park the function. Inngest uses this to pause long workflows on short-lived “serverless” runs. Another twist: generators (functions that can pause and resume) avoid messy try/catch traps because you just… stop resuming them.
Then the comments lit up. One camp, led by generator diehards, says “accept generators already!” Another crew praises C#-style CancellationTokens—opt-in “stop” signals used across that language’s ecosystem. A third camp side-eyes the garbage-collector tactic as risky: “GC can be slow—bold choice to depend on it.” Meanwhile, a practical voice points to MDN: you can’t cancel a Promise itself, but you can cancel the underlying task with AbortController in many APIs.
Amid the tech brawl, one commenter went off-topic to praise the site’s “really nice design,” which somehow made everyone madder. Verdict: promises can’t be canceled, but this community definitely can cancel each other—with flair.
Key Points
- •JavaScript promises have no native cancellation; a 2016 TC39 proposal was withdrawn due to complexity and cleanup concerns.
- •True cancellation requires cooperative cleanup to avoid leaving resources in inconsistent states.
- •A practical interruption technique returns a never-resolving promise and relies on garbage collection to stop execution without errors.
- •Throwing a special error to interrupt can be swallowed by user try/catch blocks, breaking intended control flow.
- •Generators enable controlled interruption by pausing at yield; the caller stops advancing the generator to interrupt safely, a pattern used historically with libraries like co.