Confirmed live: opening the member list crashed with "TypeError: target is
not callable" inside React's renderWithHooks. afterRendered patched
element.type directly, which works for plain function components but not
for UserRow (React.memo()-wrapped): patching the non-callable memo wrapper
object replaces it with a proxy whose *own* stub is callable, which makes
`typeof element.type === 'function'` true even though the real value is a
memo object - React's reconciler checks that before checking $$typeof, so it
takes the plain-function-component path and calls the proxy directly, whose
apply trap forwards to Reflect.apply(realMemoWrapper, ...) and throws, since
the real wrapper was never callable.
Fix: detect a memo-wrapped type and patch its inner .type (the actual render
function memo hides) instead of the wrapper itself - genuinely callable, and
leaves the wrapper's own shape untouched so React's type detection stays
correct. Shared in lib/afterRendered.ts, so it fixes UserRow now and any
future memo-wrapped target automatically.
Two of the three previously-broken module lookups now have well-evidenced
fixes (from live sweeps run during an earlier debugging session that were
never actually applied to the code):
- details.tsx: UserRow is React.memo()-wrapped, so a plain withName('UserRow')
can never match it (memo wrapper objects have no .name). Added
withMemoDefaultName (lib/filters.ts), a custom filter checking the wrapper's
inner .type.name instead, matching on the full module namespace so the
callback gets the wrapper itself - the exact reference afterJSX needs.
- name.tsx: HeaderName doesn't exist under that name anymore; ChannelHeader
is the confirmed replacement (a plain, non-memo function, found via a
name-sweep).
DisplayName (the message-author-name row) remains unresolved - never found
under any name across two live sweep sessions, likely inlined into a bigger
component now. Left as a documented, still-guarded no-op rather than guessed
at.
Includes the already-applied package.json fix (build/build:dev/generate-index/serve
now invoke @revenge-mod/plugin-cli via bun directly, bypassing its broken
node-shebang delegation that crashed both bun run build and Gradle's
packageAllPlugins).