Angular’s NG0602 means code called a function that is not allowed to run while Angular is tracking a reactive computation. Find the function named in the error, trace how it was called, and move the operation—often creating an effect, scheduling a render hook, or wrapping an observable with toSignal()—outside the computed callback or template evaluation.
What NG0602 means
Angular tracks signal reads while it evaluates reactive code, connecting the values read to the computation that may need to run again. This happens in computed() and linkedSignal() calculations, effect callbacks, resource parameters or loaders, and component template rendering, including host property bindings. When a tracked signal changes, its consumer may run again. See Angular’s signals guide.
These reactive computations should generally derive values from state, not create new work as a side effect. Creating an effect, scheduling a render callback, or subscribing to an observable from a computation that may reevaluate can cause repeated work or unintended subscriptions. A template expression is also evaluated in a reactive context, so a prohibited call can be triggered indirectly by a template.
How to find the call that caused NG0602
- Read the complete error and note the function Angular names as disallowed.
- Open the browser’s stack trace and follow it to the application call site.
- Trace upward through any helper functions to find the reactive caller: a computed or other reactive callback, or a template expression.
- Move the creation, scheduling, or subscription operation outside that reactive execution where possible.
- Repeat the application path that produced the error and check that the operation now happens at its intended setup or lifecycle point.
Angular’s NG0602 error guide recommends inspecting the named function and using the stack trace to locate where it was invoked and defined. If a helper must only be called outside reactive execution, assertNotInReactiveContext can make that expectation explicit.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11#1 Best Overall
Fix common NG0602 triggers
effect() called from a computed or template path
Create the effect outside the reactive callback or template call path. A component, directive, or service constructor is a straightforward location when an injection context is available. If you create an effect elsewhere, Angular’s effects guide documents supplying an Injector in the effect options.
These are separate constraints: effect() must not be invoked inside an active reactive context, and it also needs an injection context unless an injector is supplied. Moving the call can resolve NG0602 without resolving a separate injection-context error. An effect runs at least once and tracks signal reads during its execution, so create it where that behavior is intended.
Rank #2
afterNextRender() or afterEveryRender() scheduled in computed()
Schedule the render hook outside the computed callback, such as during component setup. If a computed reevaluates and schedules another hook each time, Angular may accumulate repeated work and hurt performance. Although Angular’s error guide mentions untracked as an opt-out, moving hook creation is the ordinary fix.
toSignal() called inside computed()
Create the signal wrapper once outside the computation, then read that signal inside the computed calculation:
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Rank #3
const dataSignal = toSignal(dataObservable$);
const derived = computed(() => {
const data = dataSignal();
return /* derive a value from data */;
});
This separates setting up the observable-to-signal conversion from deriving a value that can be recalculated. If restructuring is not possible, Angular’s error guide suggests considering a manual observable subscription; choose that only if its lifecycle and cleanup fit your code.
When to use computed(), linkedSignal(), and effects
Choose an API based on what the code needs to do, rather than using an effect to relay every state change. Angular recommends computed() for derived state, linkedSignal() when derived state must also be writable, and effects for synchronizing signals with imperative, non-signal APIs such as storage, logging, custom DOM behavior, or third-party libraries. See the effects guide.
Rank #4
Use untracked only when you want different dependency tracking
untracked(fn) runs fn without attaching signal reads made inside it as dependencies of the surrounding reactive consumer. This is a real change in behavior, not a semantics-free way to silence NG0602: a value read inside the wrapper will not make the surrounding computation rerun when that signal changes. It can make sense for incidental reads or external code whose signal reads should not trigger reevaluation, but not as a substitute for moving effect creation, render scheduling, or observable setup to the right place. Angular describes it in the signals guide and its NG0602 guidance.
A related tracking detail: asynchronous effects
Signal tracking is synchronous. In an async effect, reads made after an await are not tracked. If a signal’s current value should determine whether the effect reruns, read it before the asynchronous boundary and retain that value for the later work. This tracking rule is distinct from NG0602, but it matters when restructuring reactive code.
Free tools Windows power users keep installed
One-click scans. No signup required.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




