Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mcljs opened this issue Apr 13, 2021 · 13 comments

Comments

@mcljs
Copy link

mcljs commented Apr 13, 2021

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
Copy link

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

@rittmang
Copy link

rittmang commented Apr 16, 2021

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

@rittmang
Copy link

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

@OleksandrKucherenko
Copy link

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
Copy link

keeko20 commented Apr 22, 2021

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

@Zellement
Copy link

Zellement commented Apr 27, 2021

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
Copy link

robSturcke commented May 1, 2021

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
Copy link

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

@spencerevison
Copy link

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
Copy link

rittmang commented May 6, 2021

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
Copy link

keeko20 commented May 6, 2021

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
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests