Custom types api + gatsby-plugin-image troubleshoot

Hi all,

I'm trying to integrate prismic with a preexisting gatsby site, and am running into an issue with the custom types api. When I run the develop command, I get the error:

Missing onError handler for invocation 'building-schema', error was 'Error: Type with name "GatsbyImageLayout" does not exists'. Stacktrace was 'Error: Type with name
"GatsbyImageLayout" does not exists

and then the 'building schemas' message runs indefinitely.

I've cleared and reinstalled the plugins of interest, and I'm using v3.14.1 gatsby.

In searching around, I found that there was a prior issue that would cause a very similar error if two plugins both used gatsby-plugin-image, but in this case it seems the type is never actualized rather than being used twice and that specific issue was addressed and patched by the gatsby-plugin-image folks.

any insight into what's going wrong here?

thanks!
tucker

quick update: found the same error when attempting to use manual schemas rather than the custom types api

Hi @tjl4

Welcome to the Prismic community.

Can please share with us your project dependencies as well as your Gatsby config file to be able to investigate further.

Hi Fares,

thanks for getting back, and taking the time to help!

attached config, and pasted my dependencies below.

cheers

gatsby-config.js (1.2 KB)

"@babel/runtime": "^7.12.5",
"@iconify/icons-mdi": "^1.0.150",
"@iconify/react": "^1.1.3",
"@mdi/font": "^5.8.55",
"@mdi/js": "^5.8.55",
"@mdi/react": "^1.4.0",
"gatsby": "^2.32.13",
"gatsby-plugin-image": "^1.14.0",
"gatsby-plugin-manifest": "^2.2.38",
"gatsby-plugin-react-helmet": "^3.1.21",
"gatsby-plugin-sass": "^2.1.27",
"gatsby-plugin-sharp": "^3.14.0",
"gatsby-remark-audio": "^1.0.2",
"gatsby-source-filesystem": "^3.14.0",
"gatsby-source-prismic": "^4.2.0",
"node-sass": "^4.13.1",
"prismic": "0.0.1",
"prismic-reactjs": "^1.3.4",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-h5-audio-player": "^3.4.1",
"react-helmet": "^5.2.1",
"react-player": "^2.6.2",
"source": "0.0.3",
"typescript": "^4.0.5"

Hey there @tjl4, thanks for sending over the details.
That warning is happening because you're missing to add gatsby-plugin-image to your plugin configuration.
gatsby-config.js (1.3 KB)

I also saw that a few dependencies are out of date and create a dependency conflict when installed from scratch. It might be good to update them as well!

that was the issue, thank you!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.