Reputation: 373
I used Gatsby starter blog for my website. The last time I tried to deploy I got the following error.
1:54:59 PM: error
1:54:59 PM: Your plugins must export known APIs from their gatsby-node.js.
1:54:59 PM: The following exports aren't APIs. Perhaps you made a typo or your plugin is outdated?
1:54:59 PM: See https://www.gatsbyjs.org/docs/node-apis/ for the list of Gatsby Node APIs
1:54:59 PM: - The plugin "[email protected]" is exporting a variable named "createSchemaCustomization" which isn't an API.
1:54:59 PM: - The plugin "[email protected]" is exporting a variable named "createSchemaCustomization" which isn't an API.
I cleared the cache and tried to deploy again, but the problem is not solved.
When I try to build the project on my laptop every thing is fine. How can I fix the problem?
My project files are on github so you can check them.
Upvotes: 1
Views: 1041
Reputation: 14353
The version of gatsby-source-filesystem
is using the API version of Gatsby that requires a version higher than you have in your dependencies. createSchemaCustomization
was not introduced until Gatsby@^2.12.0 and above. The peer dependency for gatsby-source-filesystem
should be updated to reflect this, but at this time it is only set to ^2.0.0
, so it did not give you a warning.
Update the Gatsby version to the latest or a compatible version (above 2.12) using:
yarn add gatsby@latest
Then make sure to push the yarn.lock
and package.json
to your repository, so Netlify will use the correct version during the build.
Upvotes: 1