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

Error: _gatsbyCoreUtils.updateSiteMetadata is not a function #34455

Closed
2 tasks done
MJWils opened this issue Jan 12, 2022 · 6 comments · Fixed by #34462
Closed
2 tasks done

Error: _gatsbyCoreUtils.updateSiteMetadata is not a function #34455

MJWils opened this issue Jan 12, 2022 · 6 comments · Fixed by #34462
Labels
topic: cli Related to the Gatsby CLI type: bug An issue or pull request relating to a bug in Gatsby

Comments

@MJWils
Copy link

MJWils commented Jan 12, 2022

Preliminary Checks

Description

After following the steps to use the gatsby image plugin, found on https://www.gatsbyjs.com/plugins/gatsby-plugin-image, my terminal refuses to run gatsby develop.

Screenshot 2022-01-12 at 08 07 43

I'm guessing there's an issue somewhere inside my installation of Gatsby, because this error is reproduced on the most barebones of websites, see the repo / sandbox .

Reproduction Link

https://github.com/MJWils/gatsby-imageplugin-bug

Steps to Reproduce

  1. npm install -g gatsby-cli
  2. gatsby new
  3. npm install gatsby-plugin-image gatsby-plugin-sharp gatsby-source-filesystem gatsby-transformer-sharp
  4. module.exports = {
    plugins: [
    +++ gatsby-plugin-image,
    +++ gatsby-plugin-sharp,
    +++ gatsby-transformer-sharp, // Needed for dynamic images
    ],
    }
    ...

Expected Result

I expected to be able to use the plugin.

Actual Result

I was not able to use the plugin, and gatsby develop throws an UNHANDLED REJECTION error.

Environment

System:
    OS: macOS 11.6
    CPU: (8) arm64 Apple M1
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.13.2 - /usr/local/bin/node
    npm: 8.1.0 - /opt/homebrew/bin/npm
  Languages:
    Python: 2.7.16 - /usr/bin/python
  Browsers:
    Chrome: 97.0.4692.71
    Firefox: 95.0.2
    Safari: 15.0
  npmPackages:
    gatsby: ^4.4.0 => 4.4.0 
    gatsby-plugin-image: ^2.5.0 => 2.5.0 
    gatsby-plugin-postcss: ^5.5.0 => 5.5.0 
    gatsby-plugin-sharp: ^4.5.0 => 4.5.0 
    gatsby-source-filesystem: ^4.5.0 => 4.5.0 
    gatsby-transformer-sharp: ^4.5.0 => 4.5.0

Config Flags

No response

@MJWils MJWils added the type: bug An issue or pull request relating to a bug in Gatsby label Jan 12, 2022
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jan 12, 2022
@LekoArts LekoArts removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jan 12, 2022
@LekoArts
Copy link
Contributor

LekoArts commented Jan 12, 2022

Hi!

Please do two things:

  • Update your gatsby-cli to 4.5.0 (by rerunning npm install -g gatsby-cli)
  • Update gatsby to 4.5.0

You can also run npm run develop / npm run build in the repository itself. Let me know if that helped. Thanks!

@LekoArts LekoArts changed the title Error running gatsby develop with gatsby-image-plugin Error: _gatsbyCoreUtils.updateSiteMetadata is not a function Jan 12, 2022
@LekoArts LekoArts added the topic: cli Related to the Gatsby CLI label Jan 12, 2022
@plourenco
Copy link

I can confirm the above fixes the problem.

@JenniferFalkenstein
Copy link

I ran into this problem too and updating the gatsby-cli didn't work unfortunately... Here are the versions I use:

    "gatsby": "^4.4.0",
    "gatsby-core-utils": "^2.9.0",
    "gatsby-plugin-image": "^2.4.0",
    "gatsby-plugin-manifest": "^4.4.0",
    "gatsby-plugin-offline": "^5.4.0",
    "gatsby-plugin-react-helmet": "^5.4.0",
    "gatsby-plugin-sharp": "^4.4.0",
    "gatsby-source-filesystem": "^4.4.0",
    "gatsby-transformer-sharp": "^4.4.0",
    "npm": "^7.19.1",
    "prism-react-renderer": "^1.2.1",
    "react": "^17.0.1",
    "react-dom": "^17.0.1",
    "react-helmet": "^6.1.0",
    "react-spring": "^9.2.3",

@MJWils
Copy link
Author

MJWils commented Jan 12, 2022

Hi!

Please update your gatsby-cli to 4.5.0 (by rerunning npm install -g gatsby-cli) and update gatsby to 4.5.0 or run npm run develop / npm run build in the repository itself. Let me know if that helped. Thanks!

Hi LekoArts,

Thanks for coming to help. After some time I managed to figure it out, npm install --force gatsby@latest did the trick. I think the issue was my Gatsby version not matching the cli version. Odd.

Thanks again.

@MJWils
Copy link
Author

MJWils commented Jan 12, 2022

I ran into this problem too and updating the gatsby-cli didn't work unfortunately... Here are the versions I use:

    "gatsby": "^4.4.0",
    "gatsby-core-utils": "^2.9.0",
    "gatsby-plugin-image": "^2.4.0",
    "gatsby-plugin-manifest": "^4.4.0",
    "gatsby-plugin-offline": "^5.4.0",
    "gatsby-plugin-react-helmet": "^5.4.0",
    "gatsby-plugin-sharp": "^4.4.0",
    "gatsby-source-filesystem": "^4.4.0",
    "gatsby-transformer-sharp": "^4.4.0",
    "npm": "^7.19.1",
    "prism-react-renderer": "^1.2.1",
    "react": "^17.0.1",
    "react-dom": "^17.0.1",
    "react-helmet": "^6.1.0",
    "react-spring": "^9.2.3",

Hi Jennifer, I can see you have the same issue as me regarding the Gatsby version being 4.4. Try running npm install --force gatsby@latest or npm install gatsby@latest (if your pc is more friendly).

@LekoArts
Copy link
Contributor

LekoArts commented Jan 12, 2022

I'll publish a new version of gatsby-core-utils (which is an internal dependency) so y'all won't run into this.

Edit: @latest should have the fix now

bbuilds added a commit to bbuilds/youngz-resume that referenced this issue Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: cli Related to the Gatsby CLI type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants