跳到主要内容
ArcBlock Community

Cannot assign to read only property error

Vincent
支持
bugux

Hello ArcBlock team,

I think this error is something related to one of the dependencies I updated in my blocklet. It prevents the native blocklet navigation from working as seen below. I've also copied the dependencies that might be an issue, please let me know if you need additional information. Thank you.

image.png

@arcblock/did ^1.18.135 → ^1.18.138

@arcblock/did-auth ^1.18.135 → ^1.18.138

@arcblock/did-connect ^2.10.39 → ^2.10.62

@arcblock/eslint-config ^0.3.2 → ^0.3.3

@arcblock/ux ^2.10.39 → ^2.10.62

@blocklet/ui-react ^2.10.39 → ^2.10.62

5 条回复

wangshijun22个月前

Hi, can you share the screenshot of your dev tools console for more context and detail of the above error?

Vincent22个月前(edited)

It says this error not only for "Dialog", but also "Confirm", "Copyright" and others. Maybe it's a Material UI error? I can switch back to the working version if needed.

hook.js:608 Warning: Dialog: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead. Error Component Stack

at Dialog (chunk-V54QENLJ.js?v=452e4b76:51047:3)

at Confirm (chunk-V54QENLJ.js?v=452e4b76:51203:3)

at chunk-V54QENLJ.js?v=452e4b76:51303:57

at OAuthProvider (chunk-V54QENLJ.js?v=452e4b76:142179:3)

at SessionProvider (chunk-V54QENLJ.js?v=452e4b76:148152:9)

at SnackbarProvider2 (chunk-V54QENLJ.js?v=452e4b76:45496:24)

at ToastProvider (chunk-V54QENLJ.js?v=452e4b76:45726:3)

at SessionProvider (<anonymous>)

at DefaultPropsProvider (chunk-UMQWAYQA.js?v=452e4b76:5207:3)

at RtlProvider (chunk-UMQWAYQA.js?v=452e4b76:5177:3)

at ThemeProvider (chunk-UMQWAYQA.js?v=452e4b76:5103:5)

at ThemeProvider2 (chunk-UMQWAYQA.js?v=452e4b76:5309:5)

at ThemeProviderNoVars (chunk-IDWI7S5K.js?v=452e4b76:483:10)

at ThemeProvider (chunk-IDWI7S5K.js?v=452e4b76:507:3)

at StyledEngineProvider (chunk-UMQWAYQA.js?v=452e4b76:363:5)

at ThemeProvider2 (chunk-Z7FSM4NF.js?v=452e4b76:200:3)

at LocaleProvider (chunk-CXTYLLY5.js?v=452e4b76:141:3)

at QueryClientProvider (@tanstack_react-query.js?v=452e4b76:2842:3)

at App (<anonymous>)

overrideMethod @ hook.js:608

Show 1 more frame

Show less

chunk-UMQWAYQA.js?v=452e4b76:4769 Uncaught TypeError: Cannot assign to read only property 'theme' of object '#<Object>'

at attachTheme (chunk-UMQWAYQA.js?v=452e4b76:4769:15)

at styleAttachTheme (chunk-UMQWAYQA.js?v=452e4b76:4836:5)

at handleInterpolation (chunk-5VL2YHKT.js?v=452e4b76:1298:22)

at serializeStyles (chunk-5VL2YHKT.js?v=452e4b76:1393:15)

at chunk-UMQWAYQA.js?v=452e4b76:552:28

at chunk-5VL2YHKT.js?v=452e4b76:1570:16

at renderWithHooks (chunk-QZMTFCTS.js?v=452e4b76:18426:26)

at updateForwardRef (chunk-QZMTFCTS.js?v=452e4b76:21203:28)

at beginWork (chunk-QZMTFCTS.js?v=452e4b76:22824:22)

at HTMLUnknownElement.callCallback2 (chunk-QZMTFCTS.js?v=452e4b76:10552:22)

hook.js:608 The above error occurred in the <Styled(div)> component:

Vincent22个月前

image.png

wangshijun22个月前

Hi, what's your MUI dependency version, our library works best with MUI v5.16

Vincent22个月前

I found that the issue is related to the component below and things works completely fine without it. We don't immediately need the LocaleProvider, but it might be helpful to have this in the future. Thank you!

import { LocaleProvider } from '@arcblock/ux/lib/Locale/context';

回复