Ucaught TypeError: Cannot read properties of undefined (reading 'scrollTop')

[Problem]
UI kit doesn’t load previus messages on the latest version (3.4.6)

act-dom.development.js:4312 Uncaught TypeError: Cannot read properties of undefined (reading ‘scrollTop’)
at onScroll (index.tsx:67:16)
at index.ts:41:7
at HTMLUnknownElement.callCallback2 (react-dom.development.js:4164:14)
at Object.invokeGuardedCallbackDev (react-dom.development.js:4213:16)
at invokeGuardedCallback (react-dom.development.js:4277:31)
at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:4291:25)
at executeDispatch (react-dom.development.js:9041:3)
at processDispatchQueueItemsInOrder (react-dom.development.js:9073:7)
at processDispatchQueue (react-dom.development.js:9086:5)
at dispatchEventsForPlugins (react-dom.development.js:9097:3)

path to file:

/node_modules/@sendbird/src/smart-components/Channel/components/MessageList/index.tsx


tested on both 3.4.5/6 versions
[“@sendbird/uikit-react”: “3.4.5”]
[“@sendbird/uikit-react”: “3.4.6”]
[“@sendbird/chat”: “^4.2.2”]

[Reproduction Steps]
install the latest UI kit
select a channel with more than 30 - 40 messages
scroll to the top of the message list
error in the console + no additional messages gets loaded

[Frequency]
every time the message list needs to load more messages

[Current impact]
can not use this version UI kit is broken

1 Like

[“@sendbird/uikit-react”: “3.4.5”]
works after reset local cache

I am experiencing the same bug.

I think this code might be the issue.

I think it should be

const element = scrollRef.current;
1 Like

I would patch it locally but the package is minified :\

I’m seeing the same issue here

edit: downgrading to 3.4.4 seems to have resolved the issue

Hey all @jkepps @Dror_Elgabsi @Sungwoo_Jo this was fixed in 3.4.7!