Do not ScopeObserver#scopeReferenceCounts when outlet is called before controller is connected by ildarkayumov · Pull Request #771 · hotwired/stimulus
Fixes #763
The problem occurs when Outlet is accessed before controller has been connected by Stimulus and somebody tries to disconnect such controller later.
in such case ScopeObserver#elementMatchedValue is called 2 times so this.scopeReferenceCounts is eq 2.
and during ScopeObserver#elementUnmatchedValue this counter this.scopeReferenceCounts remains >= 1 so scopeDisconnected(value) is not called