Skip to content

Conversation

@weili-govtech
Copy link
Contributor

Changes

  • Upgraded to design system v3.0.0-alpha.6 and frontend-engine v2.0.0-alpha.1
  • migrated to v3 design tokens
  • fixed broken test cases
  • manually fixed media queries using desktop4k
  • note: it will be easier to review by commits

@weili-govtech weili-govtech requested a review from qroll April 14, 2025 08:00
@weili-govtech weili-govtech self-assigned this Apr 14, 2025
@qroll
Copy link
Contributor

qroll commented Apr 16, 2025

encountering a TypeError: Cannot assign to read only property '0' of object '[object Array]' when saving Contact Number, Dropdown and Radio

the error stack apparently originates from dnd kit

Screenshot 2025-04-16 at 10 38 09 AM

Copy link
Contributor

@qroll qroll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-critical, but would be good to migrate these css properties too

  • border
  • border-radius
  • transition (use Motion)

@weili-govtech
Copy link
Contributor Author

weili-govtech commented Apr 21, 2025

encountering a TypeError: Cannot assign to read only property '0' of object '[object Array]' when saving Contact Number, Dropdown and Radio

the error stack apparently originates from dnd kit

Screenshot 2025-04-16 at 10 38 09 AM

traced the issue to RHF issue #12691, it appears the yupResolver turned the entire form readOnly, this probably broke dnd-kit as it tries to mutate the value

@qroll
Copy link
Contributor

qroll commented Apr 23, 2025

traced the issue to RHF issue #12691, it appears the yupResolver turned the entire form readOnly, this probably broke dnd-kit as it tries to mutate the value

got a slightly different error for the dropdown, the radio is okay now though

Cannot assign to read only property 'label' of object '#<Object>'

tried to clone in the bulk edit resolver but that had no effect, so it should be something else causing the problem

@weili-govtech
Copy link
Contributor Author

thanks for spotting the bug, after delving deeper, I found that the error is related to how immer is making the states immutable. turning freeze off via setAutoFreeze(false) will fix the error but that defeats the purpose of using immer.

I didnt manage to find out the exact place causing the error though, even cloneDeep / JSON.parse(JSON.stringify()) failed to work, I suspect RHF maintains internal references to certain immutable values and attempted to mutate them. in view of that, I decided to downgrade it by 1 version to get around the error for now.

ngweili added 2 commits April 24, 2025 22:21
- apply via border util
- ensure it is not overwritten by border utils
- use radius token
@weili-govtech weili-govtech merged commit 481f922 into main May 5, 2025
1 check passed
@weili-govtech weili-govtech deleted the CCUBE-1703 branch May 5, 2025 02:04
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.

4 participants