Skip to content

Report fatal mixin apply errors on Fabric with the correct mod - #204

Merged
pavog merged 1 commit into
masterfrom
fabric-mixin-apply-error
Nov 13, 2026
Merged

pavog merged 1 commit into
masterfrom
fabric-mixin-apply-error

Conversation

@pavog

@pavog pavog commented Nov 13, 2026

Copy link
Copy Markdown
Member
Caused by: org.spongepowered.asm.mixin.transformer.throwables.MixinTransformerError: An unexpected critical error was encountered
	... 9 more
Caused by: org.spongepowered.asm.mixin.throwables.MixinApplyError: Mixin [enhancedstorage.mixins.json:compat.RRVItemViewOverlayMixin from mod enhanced_storage] from phase [DEFAULT] in config [enhancedstorage.mixins.json] FAILED during APPLY
	... 13 more
Caused by: org.spongepowered.asm.mixin.injection.throwables.InvalidInjectionException: Invalid descriptor on enhancedstorage.mixins.json:compat.RRVItemViewOverlayMixin from mod enhanced_storage->@Inject::enhancedstorage$deferHighlight(...)V

Builds on #203

On Fabric, FabricMixinProblem matched any Caused by: ... from mod X line after a MixinTransformerError, with (?:.*\n)* jumping to the last such line and [^ ,]+ as the mod ID.
When Mixin writes context directly after the ID (from mod enhanced_storage->@Inject::...), the mod name became the whole method descriptor, including the next line break.
Mixin errors in the PREPARE phase, which have no MixinTransformerError, were not detected on Fabric at all.

This PR adds FabricMixinApplyProblem, which reuses MixinApplyProblem from Forge and NeoForge and reads the mod ID from the MixinApplyError line.
FabricMixinProblem now only checks the direct cause of the MixinTransformerError, skips it when that cause is a MixinApplyError, and reads the mod ID as [\w-]+.
That keeps causes like InjectionError ... from mod expandability and avoids reporting the same crash twice.

FabricMixinApplyProblem is a subclass instead of registering MixinApplyProblem directly, because a mixin that loads a client-only class on a server is already reported by FabricClientOnlyModProblem.
The subclass adds the same client-only lookahead that FabricEntryStageProblem uses, so fabric-client-only-mixin.log still reports only the client-only mod.
For that, the pattern of MixinApplyProblem moved into the MIXIN_APPLY_ERROR constant.

Not covered:

  • crash reports use their own analysers and detect neither mixin problem
  • FabricEntryStageProblem still blames the mod whose entrypoint loaded the class (rrv in the new test log), next to the mixin problem
  • Quilt doesn't use the Fabric problems

Changes

  • add FabricMixinApplyProblem and register it in FabricAnalyser
  • narrow FabricMixinProblem to the direct cause of the MixinTransformerError and stop the mod ID at ->, ] and line breaks
  • move the pattern of MixinApplyProblem into the MIXIN_APPLY_ERROR constant
  • add test logs fabric-mixin-apply-error-invalid-descriptor.log and fabric-mixin-apply-error.log

@pavog
pavog merged commit d79cc7f into master Nov 13, 2026
3 checks passed
@pavog
pavog deleted the fabric-mixin-apply-error branch November 13, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant