oorestisime / gatsby-source-instagram

Create nodes from instagram posts hashtags and profiles
https://gatsby-src-instagram.netlify.com/
MIT License
149 stars 53 forks source link

Could not fetch instagram posts. Error status TypeError: Cannot read property 'user' of undefined #190

Open mcljs opened 3 years ago

mcljs commented 3 years ago

image Hello everyone today, in the morning I installed the gatsby-source-instagram plugin and it helped me, when I go to make other changes right now at night it no longer grabs me, I get this and it has not succeeded in grabbing my nodes. Somebody could help me?

Skamnoel commented 3 years ago

just got the same error in CI, was just rebuilding ( same build 4 days ago went OK )

rittmang commented 3 years ago

Fails here on Netlify too, works good enough locally. (EDIT) It started failing on local too soon after.

rittmang commented 3 years ago

Got this to work somehow, using the token from FB Dev Portal (the Insta Graph API solution in the doc somewhere)

OleksandrKucherenko commented 3 years ago

failed with error:

error There was an error in your GraphQL query:

Cannot query field "allInstaNode" on type "Query".

If you don't expect "allInstaNode" to exist on the type "Query" it is most likely a typo.
However, if you expect "allInstaNode" to exist there are a couple of solutions to common problems:

- If you added a new data source and/or changed something inside gatsby-node.js/gatsby-config.js, please try a restart of your development server
- The field might be accessible in another subfield, please try your query in GraphiQL and use the GraphiQL explorer to see which fields you can query and what shape they have
- You want to optionally use your field "allInstaNode" and right now it is not used anywhere. Therefore Gatsby can't infer the type and add it to the GraphQL schema. A quick fix is to add at least one entry with that field ("dummy content")

It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don't have to add the mentioned "dummy content". Visit our docs to learn how you can define the schema for "Query":
https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions
failed extract queries from components - 4.011s
keeko20 commented 3 years ago

same. strange fail. like 10% works, 90% fails

Zellement commented 3 years ago

Same error here, too.

There was an error in your GraphQL query:

Cannot query field "allInstaNode" on type "Query".

If you don't expect "allInstaNode" to exist on the type "Query" it is most likely a typo.
However, if you expect "allInstaNode" to exist there are a couple of solutions to common problems:

- If you added a new data source and/or changed something inside gatsby-node.js/gatsby-config.js, please try a restart of your development server
- The field might be accessible in another subfield, please try your query in GraphiQL and use the GraphiQL explorer to see which fields you can query and what shape they have
- You want to optionally use your field "allInstaNode" and right now it is not used anywhere. Therefore Gatsby can't infer the type and add it to the GraphQL schema. A quick fix is to add at least one entry with that field ("dummy content")        

It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don't have to add the mentioned "dummy content". Visit our docs to learn how you can define the schema for "Query":
https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions

File: src\components\InstagramFeed.js:10:9

failed extract queries from components - 0.711s

Was working fine on last publish in February.

robSturcke commented 3 years ago

Having the same issues, tried a local fix by forking and upgrading peer dependencies to Gatsby 3 but still getting allInstaNode cannot query failure.

Code checks out on the project, and as to why the failure comes up randomly after no changes is beyond me. Works with web scraping 1% of the time as of the past few weeks.

EDIT: Found a temp fix locally.

  1. run gatsby clean
  2. delete node_modules dir
  3. run yarn install && gatsby develop

Should pass temporarily locally. After a few start ups you may have to repeat the process, but this has worked for me and might not for you. Netlify Prod still gives allInstaNode failure though.

PawelNiedzwiecki commented 3 years ago

I've got the same issue. Tried with Gatsby 3 with no luck...

spencerevison commented 3 years ago

I'm experiencing the same issue. The request is returning HTML for the Instagram login page, rather than JSON. Looks like it's because Instagram is blacklisting IPs: https://stackoverflow.com/questions/64021222/instagram-a-1-query-why-do-i-get-login-page-instead-of-json https://stackoverflow.com/questions/57624387/dont-have-profilepage-index-but-i-have-loginandsignuppage/57722553#57722553

rittmang commented 3 years ago

Got this to work somehow, using the token from FB Dev Portal (the Insta Graph API solution in the doc somewhere)

This is working fine whenever I deploy from Netlify using the API token of course. It's yet to fail. Here are my latest builds for https://bio.lkup.cf https://app.netlify.com/sites/lkup/deploys/608d02d36e4006e925bc1e76 https://app.netlify.com/sites/lkup/deploys/6083cd58717a68c87016639d

keeko20 commented 3 years ago

Got this to work somehow, using the token from FB Dev Portal (the Insta Graph API solution in the doc somewhere)

This is working fine whenever I deploy from Netlify using the API token of course. It's yet to fail. Here are my latest builds for https://bio.lkup.cf https://app.netlify.com/sites/lkup/deploys/608d02d36e4006e925bc1e76 https://app.netlify.com/sites/lkup/deploys/6083cd58717a68c87016639d

few weeks ago I ended up doing the same thing. but it would be great without token coz this token expires every 60 days(i can't get my head around how to auto renew it with no server - static sites)

also, most basic websites getting the most recent post is more than enough(so public scraping should be enough), implementing it with instagram token gives you more things you can do

jrdavenport commented 3 years ago

I'm getting the same issue locally - it certainly looks like it is Instagram blocking the request as it works for me when going via a VPN.

It looks like i'll have to move over to using the tokens, which I was hoping to avoid as the FB development center is pretty clunky...

kekshibata commented 3 years ago

For me I get the same issue when trying to fetch locally via VPN.