MohammedRaji / react-ig-feed

A React component to display a user's Instagram photos Using Instagram Basic Graph API
https://mohammedraji.github.io/react-ig-feed/
MIT License
43 stars 23 forks source link

Error validating access token: Session has expired #4

Open LadyBlackLight opened 2 years ago

LadyBlackLight commented 2 years ago

Hi, I'm using this component for a few months but today the feed disappears of my page and I'm getting this access token error, it's seems that the token has expired, there is a method to allow the token to not expire?

{ "error": { "message": "Error validating access token: Session has expired on Tuesday, 09-Nov-21 07:10:15 PST. The current time is Wednesday, 10-Nov-21 07:57:55 PST.", "type": "OAuthException", "code": 190, "fbtrace_id": "A1k9iGqkQ8hyDAZqNTeGZLz" } }

CalebBarnes commented 2 years ago

When my token expires it throws an error and breaks the entire site.

Error validating access token: Session has expired

Error in function InstagramFeed in ./node_modules/react-ig-feed/dist/index.modern.js:69 Cannot read properties of undefined (reading 'slice')

  67 |     className: styles.instagramItems,
  68 |     ref: placeholder
> 69 |   }, showImage && data.slice(0, counter).map(function (item, index) {
     |   ^
  70 |     return /*#__PURE__*/React.createElement("div", {
  71 |       key: index,
  72 |       className: styles.instagramItem

Probably just need to check for data before trying to slice and map it.

@MohammedRaji This issue is breaking production sites so if you have any time to look into it that would be amazing!