Summary
On Discord 0.0.412 (stable, macOS), BetterAnimations v2.1.15 throws an InternalError on render whenever the thread/members sidebar mounts. The plugin's own validator reports two unresolved modules:
Validator: Found 2 issues in DiscordModules:
• Badge: Unresolved module.
• SidebarType: Unresolved module.
Root cause
SidebarType resolves to undefined, so reading .VIEW_MOD_REPORT off it throws. In BetterAnimations.plugin.js (v2.1.15, line ~32570):
function buildSwitchKey(state) {
return JSON.stringify(state?.type === SidebarType.VIEW_MOD_REPORT ? {
...state,
details: pick(state.details, ["userId"])
} : state);
}
buildSwitchKey is the default value of switchTransitionKey in SidebarTransition, so it runs on every render of that component and takes the subtree down. Everything below SidebarTransition in the stack is React unwinding.
A defensive SidebarType?.VIEW_MOD_REPORT would downgrade this from a crash to a missing animation, but the real fix is the module lookup for SidebarType (and Badge) against current Discord.
Environment
- BetterAnimations: 2.1.15 — verified byte-identical (SHA-1) to the official v2.1.15 release asset
- Discord: 0.0.412 stable,
stable-osx-universal
- BetterDiscord: 1.14.1 — verified byte-identical to the latest release asar
- macOS 26.6.2
Reproduction
Enable the threadSidebar and/or threadSidebarSwitch modules and open a channel with the thread/members sidebar.
Workaround
Disabling both threadSidebar and threadSidebarSwitch avoids it, since the call site guards with if (!module.isEnabled() && !switchModule.isEnabled()) return; — disabling one alone is not enough. All other modules work normally.
Possibly related
#109 reports an unresolved-module failure on the same plugin version, but at patch-apply time (PatcherWrapper._patch) rather than at render. May share a root cause in module resolution against newer Discord builds.
Full stack trace
InternalError: TypeError: Cannot read properties of undefined (reading 'VIEW_MOD_REPORT')
at buildSwitchKey (betterdiscord://betterdiscord/plugins/BetterAnimations.plugin.js:32572:53)
at SidebarTransition (betterdiscord://betterdiscord/plugins/BetterAnimations.plugin.js:32577:121)
at o8 (betterdiscord://betterdiscord/webpack-modules/patched/490/490349.js:7:79563)
at iP (betterdiscord://betterdiscord/webpack-modules/patched/490/490349.js:7:99957)
at iX (betterdiscord://betterdiscord/webpack-modules/patched/490/490349.js:7:110987)
at l_ (betterdiscord://betterdiscord/webpack-modules/patched/490/490349.js:7:144620)
at eval (betterdiscord://betterdiscord/webpack-modules/patched/490/490349.js:7:144465)
at lw (betterdiscord://betterdiscord/webpack-modules/patched/490/490349.js:7:144473)
at ls (betterdiscord://betterdiscord/webpack-modules/patched/490/490349.js:7:139848)
at lK (betterdiscord://betterdiscord/webpack-modules/patched/490/490349.js:7:163105)
at l$ (betterdiscord://betterdiscord/webpack-modules/patched/490/490349.js:7:161318)
at lX (betterdiscord://betterdiscord/webpack-modules/patched/490/490349.js:7:161663)
at eval (betterdiscord://betterdiscord/webpack-modules/patched/490/490349.js:7:160947)
at SidebarTransition (betterdiscord://betterdiscord/plugins/BetterAnimations.plugin.js:32577:31)
at MainWindowOnly (betterdiscord://betterdiscord/plugins/BetterAnimations.plugin.js:31581:28)
at ErrorBoundary (betterdiscord://betterdiscord/plugins/BetterAnimations.plugin.js:31335:22)
at dj (betterdiscord://betterdiscord/webpack-modules/patched/675/675782.js:7:119617)
at div (<anonymous>)
at betterdiscord/betterdiscord.js:7:1198
at A (betterdiscord://betterdiscord/webpack-modules/patched/156/156828.js:7:1129)
at Le (betterdiscord://betterdiscord/webpack-modules/patched/521/521376.js:11:672818)
at t (betterdiscord://betterdiscord/webpack-modules/patched/806/806163.js:7:6225)
at o (betterdiscord://betterdiscord/webpack-modules/patched/549/549711.js:7:423)
at t (betterdiscord://betterdiscord/webpack-modules/patched/806/806163.js:7:6868)
at div (<anonymous>)
at Suspender (betterdiscord://betterdiscord/plugins/BetterAnimations.plugin.js:22651:23)
at Suspense (<anonymous>)
at Freeze (betterdiscord://betterdiscord/plugins/BetterAnimations.plugin.js:22655:20)
at div (<anonymous>)
at AnimeContainer (betterdiscord://betterdiscord/plugins/BetterAnimations.plugin.js:22961:28)
at t (betterdiscord://betterdiscord/webpack-modules/patched/93/93932.js:7:1063)
at AnimeTransition (betterdiscord://betterdiscord/plugins/BetterAnimations.plugin.js:23051:4)
at div (<anonymous>)
at t (betterdiscord://betterdiscord/webpack-modules/patched/758/758588.js:7:904)
at AppViewTransition (betterdiscord://betterdiscord/plugins/BetterAnimations.plugin.js:31839:31)
at ErrorBoundary (betterdiscord://betterdiscord/plugins/BetterAnimations.plugin.js:31335:22)
at div (<anonymous>)
at Suspender (betterdiscord://betterdiscord/plugins/BetterAnimations.plugin.js:22651:23)
at Suspense (<anonymous>)
at Freeze (betterdiscord://betterdiscord/plugins/BetterAnimations.plugin.js:22655:20)
at div (<anonymous>)
at AnimeContainer (betterdiscord://betterdiscord/plugins/BetterAnimations.plugin.js:22961:28)
at t (betterdiscord://betterdiscord/webpack-modules/patched/93/93932.js:7:1063)
at AnimeTransition (betterdiscord://betterdiscord/plugins/BetterAnimations.plugin.js:23051:4)
at div (<anonymous>)
at t (betterdiscord://betterdiscord/webpack-modules/patched/758/758588.js:7:904)
at AppViewTransition (betterdiscord://betterdiscord/plugins/BetterAnimations.plugin.js:31839:31)
at ErrorBoundary (betterdiscord://betterdiscord/plugins/BetterAnimations.plugin.js:31335:22)
at div (<anonymous>)
at div (<anonymous>)
at betterdiscord/betterdiscord.js:7:1198
at div (<anonymous>)
at Layer (betterdiscord://betterdiscord/plugins/BetterAnimations.plugin.js:32989:19)
at Suspender (betterdiscord://betterdiscord/plugins/BetterAnimations.plugin.js:22651:23)
at Suspense (<anonymous>)
at Freeze (betterdiscord://betterdiscord/plugins/BetterAnimations.plugin.js:22655:20)
at div (<anonymous>)
at AnimeContainer (betterdiscord://betterdiscord/plugins/BetterAnimations.plugin.js:22961:28)
at t (betterdiscord://betterdiscord/webpack-modules/patched/93/93932.js:7:1063)
at AnimeTransition (betterdiscord://betterdiscord/plugins/BetterAnimations.plugin.js:23051:4)
at LayerTransition (betterdiscord://betterdiscord/plugins/BetterAnimations.plugin.js:32997:29)
at t (betterdiscord://betterdiscord/webpack-modules/patched/758/758588.js:7:904)
at ErrorBoundary (betterdiscord://betterdiscord/plugins/BetterAnimations.plugin.js:31335:22)
at div (<anonymous>)
at s (betterdiscord://betterdiscord/webpack-modules/patched/868/868285.js:7:1182)
at yN (betterdiscord://betterdiscord/webpack-modules/patched/521/521376.js:11:722663)
at betterdiscord/betterdiscord.js:7:1198
at div (<anonymous>)
at nU (betterdiscord://betterdiscord/webpack-modules/patched/521/521376.js:11:19926)
at eval (betterdiscord://betterdiscord/webpack-modules/patched/521/521376.js:11:723892)
at Authenticated(<Unknown>) (<anonymous>)
at t2 (betterdiscord://betterdiscord/webpack-modules/patched/521/521376.js:11:12059)
at t (betterdiscord://betterdiscord/webpack-modules/patched/806/806163.js:7:6225)
at t (betterdiscord://betterdiscord/webpack-modules/patched/806/806163.js:7:6868)
at kE (betterdiscord://betterdiscord/webpack-modules/patched/521/521376.js:57:25074)
at t (betterdiscord://betterdiscord/webpack-modules/patched/806/806163.js:7:6225)
at t (betterdiscord://betterdiscord/webpack-modules/patched/806/806163.js:7:6868)
at BT (betterdiscord://betterdiscord/webpack-modules/patched/521/521376.js:57:88835)
at div (<anonymous>)
at kx (betterdiscord://betterdiscord/webpack-modules/patched/521/521376.js:57:32267)
at E (betterdiscord://betterdiscord/webpack-modules/patched/365/365912.js:7:755)
at VerificationLayerProvider (<anonymous>)
at u (betterdiscord://betterdiscord/webpack-modules/patched/21/21161.js:7:755)
at u (betterdiscord://betterdiscord/webpack-modules/patched/681/681582.js:7:539)
at div (<anonymous>)
at div (<anonymous>)
at E (betterdiscord://betterdiscord/webpack-modules/patched/365/365912.js:7:755)
at AppLayerProvider (<anonymous>)
at p (betterdiscord://betterdiscord/webpack-modules/patched/267/267102.js:7:1449)
at P (betterdiscord://betterdiscord/webpack-modules/patched/259/259678.js:7:8791)
at y (betterdiscord://betterdiscord/webpack-modules/patched/670/670735.js:7:1808)
at u (betterdiscord://betterdiscord/webpack-modules/patched/638/638421.js:7:540)
at I (betterdiscord://betterdiscord/webpack-modules/patched/697/697138.js:7:1063)
at p (betterdiscord://betterdiscord/webpack-modules/patched/597/597619.js:7:1062)
at I (betterdiscord://betterdiscord/webpack-modules/patched/164/164942.js:7:1805)
at m (betterdiscord://betterdiscord/webpack-modules/patched/366/366632.js:7:1809)
at y (betterdiscord://betterdiscord/webpack-modules/patched/366/366632.js:7:2043)
at d (betterdiscord://betterdiscord/webpack-modules/patched/460/460890.js:7:2772)
at G (betterdiscord://betterdiscord/webpack-modules/patched/164/164942.js:7:2550)
at Fz (betterdiscord://betterdiscord/webpack-modules/patched/521/521376.js:57:68897)
at Bm (betterdiscord://betterdiscord/webpack-modules/patched/521/521376.js:57:93599)
at eval (betterdiscord://betterdiscord/webpack-modules/patched/386/386693.js:7:24488)
at eU (betterdiscord://betterdiscord/webpack-modules/patched/386/386693.js:7:33834)
at N (betterdiscord://betterdiscord/webpack-modules/patched/965/965830.js:7:9464)
at w (betterdiscord://betterdiscord/webpack-modules/patched/848/848421.js:7:3179)
at A (betterdiscord://betterdiscord/webpack-modules/patched/848/848421.js:7:4429)
at k (betterdiscord://betterdiscord/webpack-modules/patched/848/848421.js:7:3798)
at N (betterdiscord://betterdiscord/webpack-modules/patched/848/848421.js:7:8472)
at t (betterdiscord://betterdiscord/webpack-modules/patched/806/806163.js:7:3401)
at t (betterdiscord://betterdiscord/webpack-modules/patched/667/667498.js:7:8373)
at B3 (betterdiscord://betterdiscord/webpack-modules/patched/521/521376.js:57:111922)
at p (betterdiscord://betterdiscord/webpack-modules/patched/597/597619.js:7:1062)
at I (betterdiscord://betterdiscord/webpack-modules/patched/164/164942.js:7:1805)
at m (betterdiscord://betterdiscord/webpack-modules/patched/366/366632.js:7:1809)
at y (betterdiscord://betterdiscord/webpack-modules/patched/366/366632.js:7:2043)
at d (betterdiscord://betterdiscord/webpack-modules/patched/460/460890.js:7:2772)
at G (betterdiscord://betterdiscord/webpack-modules/patched/164/164942.js:7:2550)
Summary
On Discord
0.0.412(stable, macOS), BetterAnimationsv2.1.15throws an InternalError on render whenever the thread/members sidebar mounts. The plugin's own validator reports two unresolved modules:Root cause
SidebarTyperesolves toundefined, so reading.VIEW_MOD_REPORToff it throws. InBetterAnimations.plugin.js(v2.1.15, line ~32570):buildSwitchKeyis the default value ofswitchTransitionKeyinSidebarTransition, so it runs on every render of that component and takes the subtree down. Everything belowSidebarTransitionin the stack is React unwinding.A defensive
SidebarType?.VIEW_MOD_REPORTwould downgrade this from a crash to a missing animation, but the real fix is the module lookup forSidebarType(andBadge) against current Discord.Environment
stable-osx-universalReproduction
Enable the
threadSidebarand/orthreadSidebarSwitchmodules and open a channel with the thread/members sidebar.Workaround
Disabling both
threadSidebarandthreadSidebarSwitchavoids it, since the call site guards withif (!module.isEnabled() && !switchModule.isEnabled()) return;— disabling one alone is not enough. All other modules work normally.Possibly related
#109 reports an unresolved-module failure on the same plugin version, but at patch-apply time (
PatcherWrapper._patch) rather than at render. May share a root cause in module resolution against newer Discord builds.Full stack trace