-
Notifications
You must be signed in to change notification settings - Fork 19
newsFeeds[slug].follow is not a function #23
Comments
Though swapping the for loop allowed following, the flat and aggregated feeds did not have access to the followed user feed. |
Hi, thanks for posting about these challenges and asking questions. Apologies for not getting back to you sooner. Are you able to confirm the list of newFeeds is populated appropriately? Given the errors cascade through to subsequent calls, I suspect you may have some mis-configuration and they app is simply misbehaving as a result. There's also a possibility of something environment related. Can you confirm the version of Node you're running and that you've got latest commits from our master branch? |
Hi @dwightgunning, thanks for your reply. The feeds are mostly fine, although sometimes I get un-enriched results i.e. I'm running Node v6.2.1 and getstream-node module is v1.5.0. |
@yuccayucca Any chance you're able to test this against the latest version of Node (8.5.0)? |
@nparsons08 I can locally, but our servers use an even older version than that - 4.4.7. |
@yuccayucca I installed the latest version of the code and ran into issues with Node v6.2.1; however, the issue that I faced was due to railing commas (something that is not supported in outdated versions of Node). That said, my suspicion is that it is an issue related to your Node version. Out of curiosity, when did you clone the repo? If you can provide a commit SHA, that would be more helpful. Thank you! |
@nparsons08 you're right, I had to remove those commas as well. Node version it is, then. |
@yuccayucca - yep, if you can grab the SHA of the commit you're working against, we can be more sure about the code you're working with. This repo has had quite a few changes going into the master branch over the last few weeks so depending on when you cloned or last pulled, you may not have the latest. $ git log -1 |
@dwightgunning here's the latest commit: |
I can't spot that commit in our repository. So I suspect you've probably made some new commits in your local repository (I probably should have considered that when phrasing the question). Are you able to check that you've got a5428aa the current HEAD commit in our master branch? You can run It'd actually be even easier to help you with this if you have pushed your changes to a fork of the repository in Github. Then we can clone it and see the exact code you're working with. Would that be an option? |
It's true that I made a commit after that (just removed commas in models.js), but the previous one was: |
Now I see it. That commit is from a different Stream-Example-Nodejs. Let us take a closer look. |
Hi @yuccayucca, I was able to have a deeper look over the weekend and it's likely due to an outdated version of Node.js. Are you able to upgrade your local environment in addition to your servers? For what it's worth, the latest versions of Node come with several feature upgrades and bug fixes – so upgrading is highly recommended. Furthermore, is the app that you're building a proof of concept or something you're looking to deploy into production? Just trying to wrap my head around your use-case. Cheers! |
@yuccayucca - hoping to get a response for you here - can you respond on those questions from Nick? We typically close off issues that aren't clear bugs and are left unattended for 14 days. Of course we're hoping to hear from you and helping you get this sorted. |
I've been following the Node.js example and I keep getting
newsFeeds[slug].follow is not a function
and
newsFeeds[slug].unfollow is not a function
,while providing all the correct data.
I looked into the module's FeedManager.js file, as the error was being generated there and swapped the enhanced loop
for (var slug in newsFeeds) {
on lines 52 and 64 to the regular
for(var slug=0; slug< newsFeeds.length; slug++){
and it worked perfectly.
Do you know why might this be happening and is there a way to fix this without making a custom module?
The text was updated successfully, but these errors were encountered: