Skip to content

MOBX swallows a thrown MOBX error when using sort() on an observed array #4587

@andreash

Description

@andreash

Intended outcome:

I used "sort" on a observed array - mistake on my side. However, the error which is thrown by MOBX, ( [MobX] [mobx] observableArray.sort() mutates the array in-place, which is not allowed inside a derivation. Use array.slice().sort() instead) should be shown.

Actual outcome:

In derivation.ts in Line 188 the error is caught and converted into a CaughtException() object and never reported.

How to reproduce the issue:

Use sort() on an observed array
Versions

6.15.0 mobx
4.1.1. mobx-react-lite

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions