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

Update to be compatible with Gatsby 3 #210

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

m99coder
Copy link

@m99coder m99coder commented Aug 6, 2021

From what I can see, there are no errors thrown after having upgraded the dependencies to be compatible with Gatsby 3. The only thing I had to change was commenting out the hashtags in /example/pages/index.js. Revert that change in case your local example setup is different. Also, feel free to adjust this PR as it suits you. Hope this helps also others already running Gatsby 3.

Fixed this warning that relates to this deprecation:

Calling "touchNode" with an object containing the nodeId is deprecated.
Please pass the node directly to the function: touchNode(node)
"touchNode" was called by gatsby-source-instagram

Fixes #188

@netlify
Copy link

netlify bot commented Aug 6, 2021

👷 Deploy request for gatsby-src-instagram accepted.

🔨 Explore the source changes: 791fefd

🔍 Inspect the deploy log: https://app.netlify.com/sites/gatsby-src-instagram/deploys/610d8323b5f0760007b5e0c2

@oorestisime
Copy link
Owner

Hey thanks for this!!!!
I am on holidays till end of next week so i ll be able to release this later.
approved the netlify build to see how it works

@m99coder
Copy link
Author

m99coder commented Aug 9, 2021

@oorestisime Looks like Node.js v10 is configured in Netlify, but Gatsby 3.x requires at least v12.

@oorestisime
Copy link
Owner

Added node version 12 but still fails (sorry cant check more than that for another week )

@m99coder
Copy link
Author

I will have another look as soon as I have time myself 😄 Thanks.

@oorestisime
Copy link
Owner

Hey i just came back from holidays. Let me know if you want me to take a look as well :)

@m99coder
Copy link
Author

Hey i just came back from holidays. Let me know if you want me to take a look as well :)

The same for me 😄 Yes please have a look as well. That would help. Thanks in advance.

@damian-turek
Copy link

Any luck with this upgrade? I am using Gatsby 3 and can't install your plugin via npm:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: xxx
npm ERR! Found: gatsby-source-filesystem@3.13.0
npm ERR! node_modules/gatsby-source-filesystem
npm ERR!   gatsby-source-filesystem@"^3.1.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer gatsby-source-filesystem@"^2.0.27" from gatsby-source-instagram@0.9.0
npm ERR! node_modules/gatsby-source-instagram
npm ERR!   gatsby-source-instagram@"*" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

@t2ca
Copy link

t2ca commented Oct 22, 2021

I'm getting new errors with Gatsby 4

 ERROR #11321  PLUGIN

"gatsby-source-instagram" threw an error while running the
sourceNodes lifecycle:

Cannot read properties of undefined (reading 'type')

  133 |   if (data) {
  134 |     return Promise.all(data.map(async datum => {
> 135 |       const res = await
normalize.downloadMediaFile({
      |                   ^
  136 |         datum: processDatum(datum, params),
  137 |         store,
  138 |         cache,

File:node_modules/gatsby-source-instagram/gatsby-node.js:135
     :19

@zjp
Copy link

zjp commented Dec 12, 2021

This pull request is also working for me on Gatsby 4.

After I used yarn add https://github.com/m99coder/gatsby-source-instagram to pull your branch into my project it built successfully.

@pkuczynski
Copy link

Any chance to get it merged and released?

@@ -120,7 +120,7 @@ exports.sourceNodes = async (
{ actions, store, cache, createNodeId },
options
) => {
const { createNode, touchNode } = actions
const { createNode, touchNode, getNode } = actions

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this works. At least it didn't work for me on gatsby v4. I got getNode like this:

exports.sourceNodes = async (
  { actions, store, cache, createNodeId, getNode },
  options
) => {

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct. This change is required.

@oorestisime
Copy link
Owner

Maybe we can close this in favor of #239

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

Successfully merging this pull request may close these issues.

New gatsby version issue
7 participants