Skip to content

Conversation

@jho406
Copy link
Collaborator

@jho406 jho406 commented Nov 6, 2025

When using useSetFragment, the obj returned was frozen. This cause a javascript invariant violation which breaks the proxy leading to this error discovered on

#173

Uncaught TypeError: 'get' on proxy: property 'toggleForm' is a read-only and non-configurable data property on the proxy target but the proxy did not return its actual value (expected '#<Object>' but got '#<Object>')
    at Item (ItemsList.jsx:11:5)
    at Object.react_stack_bottom_frame (react-dom-client.development.js:23863:20)
... etc ..

The fix is to use a local instance of Immer and setting the auto freeze to false.

When using `useSetFragment`, the obj returned was frozen. This cause a javascript
invariant violation which breaks the proxy leading to this error discovered on

#173

```
Uncaught TypeError: 'get' on proxy: property 'toggleForm' is a read-only and non-configurable data property on the proxy target but the proxy did not return its actual value (expected '#<Object>' but got '#<Object>')
    at Item (ItemsList.jsx:11:5)
    at Object.react_stack_bottom_frame (react-dom-client.development.js:23863:20)
... etc ..
```

The fix is to use a local instance of Immer and setting the auto freeze to false.
@jho406 jho406 force-pushed the fix-use-set-fragment-proxy branch from f3ad2b1 to c5a0230 Compare November 7, 2025 22:02
@jho406 jho406 merged commit 33db292 into v2 Nov 7, 2025
3 checks passed
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.

2 participants