# Cannot read properties of undefined (reading 'toLowerCase')

**URL:** <https://forum.social.plus/t/cannot-read-properties-of-undefined-reading-tolowercase/570>\
**Category:** Web\
**Created:** [November 8, 2022, 1:24pm UTC](https://forum.social.plus/t/cannot-read-properties-of-undefined-reading-tolowercase/570 "2022-11-08T13:24:09Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![symlinktech](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/symlinktech/32/289_2.png) [@symlinktech](https://forum.social.plus/u/symlinktech)\
**Post date:** [November 8, 2022, 1:24pm UTC](https://forum.social.plus/t/cannot-read-properties-of-undefined-reading-tolowercase/570/1 "2022-11-08T13:24:10Z")

</div>

this error comming when i call UserRepository.getUser(“654321”)

 ![Screenshot_2](https://europe1.discourse-cdn.com/flex013/uploads/amity/original/1X/7a9ab259d16ac72a8e652cb754ad96ff3ffd0445.png)

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [November 8, 2022, 1:34pm UTC](https://forum.social.plus/t/cannot-read-properties-of-undefined-reading-tolowercase/570/2 "2022-11-08T13:34:23Z")

</div>

Hello @symlinktech , can we please have a full screenshot of the error? what are you trying to accomplish? so we can understand your use case and what is your current SDK version?

---

<div class="post-metadata">

**Author:** ![symlinktech](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/symlinktech/32/289_2.png) [@symlinktech](https://forum.social.plus/u/symlinktech)\
**Post date:** [November 8, 2022, 1:40pm UTC](https://forum.social.plus/t/cannot-read-properties-of-undefined-reading-tolowercase/570/3 "2022-11-08T13:40:24Z")

</div>

can we please have a full screenshot of the error?

 ![Screenshot_1](https://europe1.discourse-cdn.com/flex013/uploads/amity/original/1X/cf1324b6e058f72fa099fbf05357687bff38bf95.png)

what are you trying to accomplish?  
Comment : I want to fetch user profile by user\_id

we can understand your use case and what is your current SDK version?  
Comment : @amityco/js-sdk": "^5.29.0 this is my sdk version

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [November 8, 2022, 1:41pm UTC](https://forum.social.plus/t/cannot-read-properties-of-undefined-reading-tolowercase/570/4 "2022-11-08T13:41:45Z")

</div>

@symlinktech Thank you for your information, I will pass to our team to check on this 🙏

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [November 9, 2022, 9:23am UTC](https://forum.social.plus/t/cannot-read-properties-of-undefined-reading-tolowercase/570/5 "2022-11-09T09:23:41Z")

</div>

Hello @symlinktech we cannot reproduce this on our side, could you please provide us more code and where is the toLowerCase in your sourcecode?

---

<div class="post-metadata">

**Author:** ![symlinktech](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/symlinktech/32/289_2.png) [@symlinktech](https://forum.social.plus/u/symlinktech)\
**Post date:** [November 9, 2022, 11:11am UTC](https://forum.social.plus/t/cannot-read-properties-of-undefined-reading-tolowercase/570/6 "2022-11-09T11:11:41Z")

</div>

client.registerSession({ userId, authToken }) automatcally destroy after page reload.  
How to store it to call repository after page reload?

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [November 10, 2022, 4:38am UTC](https://forum.social.plus/t/cannot-read-properties-of-undefined-reading-tolowercase/570/7 "2022-11-10T04:38:55Z")

</div>

Hello, please see how to handle this in this sample project [GitHub - AmityCo/Amity-Web-SDK-pagination-example](https://github.com/AmityCo/Amity-Web-SDK-pagination-example)

---

<div class="post-metadata">

**Author:** ![symlinktech](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/symlinktech/32/289_2.png) [@symlinktech](https://forum.social.plus/u/symlinktech)\
**Post date:** [November 15, 2022, 9:47am UTC](https://forum.social.plus/t/cannot-read-properties-of-undefined-reading-tolowercase/570/8 "2022-11-15T09:47:42Z")

</div>

Hello, how to send files using axios node js  
[https://api.us.amity.co/api/v4/images](https://api.us.amity.co/api/v4/images)

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [November 15, 2022, 10:16am UTC](https://forum.social.plus/t/cannot-read-properties-of-undefined-reading-tolowercase/570/9 "2022-11-15T10:16:42Z")

</div>

Hi @symlinktech You meant to upload and create file posts? If you would like to use api, you could call this api to upload files, please see the sample curl below. Unfortunately, we don’t have example with axios.

```auto
curl --location --request POST 'https://api.us.amity.co/api/v3/files' \
--header 'Authorization: Bearer ACCESSTOKEN' \
--form 'file=@"/Users/usernam/example.png"'

```

Upload and create files are also available on SDK as well, please see more detail here: [File Post - Amity Docs](https://docs.amity.co/social/web/posts/create-post/file-post)

---

<div class="post-metadata">

**Author:** ![symlinktech](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/symlinktech/32/289_2.png) [@symlinktech](https://forum.social.plus/u/symlinktech)\
**Post date:** [November 16, 2022, 8:58am UTC](https://forum.social.plus/t/cannot-read-properties-of-undefined-reading-tolowercase/570/10 "2022-11-16T08:58:52Z")

</div>

How can I get the global feeds  
using ```  
[https://api.us.amity.co/api/v3/global-feeds](https://api.us.amity.co/api/v3/global-feeds)

```auto
this api but only getting my feeds
```

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [November 16, 2022, 9:05am UTC](https://forum.social.plus/t/cannot-read-properties-of-undefined-reading-tolowercase/570/11 "2022-11-16T09:05:59Z")

</div>

Hi @symlinktech you can use that api or this one [Amity API](https://api-docs.amity.co/#/GlobalFeed/get_api_v4_me_global_feeds) and it should work. Have you joined any communities?

---

<div class="post-metadata">

**Author:** ![symlinktech](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/symlinktech/32/289_2.png) [@symlinktech](https://forum.social.plus/u/symlinktech)\
**Post date:** [November 16, 2022, 9:18am UTC](https://forum.social.plus/t/cannot-read-properties-of-undefined-reading-tolowercase/570/12 "2022-11-16T09:18:10Z")

</div>

no, so global feed mean community post?

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [November 16, 2022, 9:31am UTC](https://forum.social.plus/t/cannot-read-properties-of-undefined-reading-tolowercase/570/13 "2022-11-16T09:31:22Z")

</div>

Correct, global feed contains posts from users you have followed and communities you have joined.
