Skip to content

why entities is not iterable also it shows Cannot read properties of undefined (reading 'indices') #221

Description

@railav61

When using with valid, working tweet IDs, the component crashes with TypeError: entities is not iterable even though the raw API response contains fully populated entities — including urls, user_mentions, and media with all their subfields present and correct. The tweets are publicly accessible, the IDs are valid, and the API response contains no missing or null fields.

error shown in console -

Uncaught Error: entities is not iterable
at addEntities (utils.js:85:26)
at getEntities (utils.js:45:5)
at enrichTweet (utils.js:144:19)
at EmbeddedTweet.useMemo[tweet] (embedded-tweet.js:16:41)
at mountMemo (react-dom-client.development.js:7743:23)
at Object.useMemo (react-dom-client.development.js:23263:18)
at exports.useMemo (react.development.js:1217:34)
at EmbeddedTweet (embedded-tweet.js:16:25)
at Tweet (swr.js:14:29)
at PinCard (TwitterPage.tsx:206:11)
at TwitterPage.tsx:91:19
at Array.map ()
at TwitterManager (TwitterPage.tsx:90:22)
at AdminDashboard (page.tsx:1321:33)

also when i try to fix it manually again an error pops out - Cannot read properties of undefined (reading 'indices')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions