You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 15, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 15, 2023. It is now read-only.
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?
Though swapping the for loop allowed following, the flat and aggregated feeds did not have access to the followed user feed.
Crude, but this fixes it: ps.push(newsFeeds.timeline.unfollow(this.settings.userFeed, targetUserId)); ps.push(newsFeeds.timeline_aggregated.unfollow(this.settings.userFeed, targetUserId));
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?
The feeds are mostly fine, although sometimes I get un-enriched results i.e. object: 'Follow: id' opposed to the usual breakdown to user object, target object, etc.
Still trying to work this out, could this also be related?
I'm running Node v6.2.1 and getstream-node module is v1.5.0.
@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.
I'm not sure when exactly I cloned it, I'd say about two and a half weeks ago. Commit SHA of the cloning or..?
@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.
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 git log without the -1 to get more of the history.
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: commit 2649b9b34dec8eecf2d8f0972e5c21070a9c5ca5 Author: Nick Parsons <nparsons08@gmail.com> Date: Fri Aug 25 14:57:39 2017 -0600 Update app.json
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.
@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.
Activity
yuccayucca commentedon Sep 13, 2017
Though swapping the for loop allowed following, the flat and aggregated feeds did not have access to the followed user feed.
Crude, but this fixes it:
ps.push(newsFeeds.timeline.unfollow(this.settings.userFeed, targetUserId)); ps.push(newsFeeds.timeline_aggregated.unfollow(this.settings.userFeed, targetUserId));dwightgunning commentedon Sep 14, 2017
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?
yuccayucca commentedon Sep 19, 2017
Hi @dwightgunning, thanks for your reply.
The feeds are mostly fine, although sometimes I get un-enriched results i.e.
object: 'Follow: id'opposed to the usual breakdown to user object, target object, etc.Still trying to work this out, could this also be related?
I'm running Node v6.2.1 and getstream-node module is v1.5.0.
astrotars commentedon Sep 19, 2017
@yuccayucca Any chance you're able to test this against the latest version of Node (8.5.0)?
yuccayucca commentedon Sep 19, 2017
@nparsons08 I can locally, but our servers use an even older version than that - 4.4.7.
Can this pose problems in the future?
astrotars commentedon Sep 20, 2017
@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!
yuccayucca commentedon Sep 21, 2017
@nparsons08 you're right, I had to remove those commas as well. Node version it is, then.
I'm not sure when exactly I cloned it, I'd say about two and a half weeks ago. Commit SHA of the cloning or..?
dwightgunning commentedon Sep 21, 2017
@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.
yuccayucca commentedon Sep 22, 2017
@dwightgunning here's the latest commit:
2649b9b34dec8eecf2d8f0972e5c21070a9c5ca5dwightgunning commentedon Sep 22, 2017
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
git logwithout the-1to get more of the history.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?
yuccayucca commentedon Sep 22, 2017
It's true that I made a commit after that (just removed commas in models.js), but the previous one was:
commit 2649b9b34dec8eecf2d8f0972e5c21070a9c5ca5 Author: Nick Parsons <nparsons08@gmail.com> Date: Fri Aug 25 14:57:39 2017 -0600 Update app.jsondwightgunning commentedon Sep 22, 2017
Now I see it. That commit is from a different Stream-Example-Nodejs. Let us take a closer look.
astrotars commentedon Sep 25, 2017
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!
dwightgunning commentedon Sep 29, 2017
@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.