Error with gatsby-plugin-styled-components and Gatsby v2.24.67: pluginOptionsSchema not available
See original GitHub issueDescription
Apologies if I’m missing something obvious here. While running gatsby build
I see the following error message in gatsby-plugin-styled-components
:
ERROR #11329
Your plugins must export known APIs from their gatsby-node.js.
See https://www.gatsbyjs.org/docs/node-apis/ for the list of Gatsby node APIs.
- The plugin gatsby-plugin-styled-components@3.3.14 is using the API "pluginOptionsSchema" which is not available in your version of Gatsby.
Not sure if I should be using a different version of Gatsby? I found this - again, not sure how relevant it is here?
Steps to reproduce
I’ve created a minimal reproduction of the issue here. It’s just a hello world starter with gatsby-plugin-styled-components
plugin installed. Steps to reproduce:
- Clone https://github.com/daiviknema/styled-components-issue
- Run
npm install
- Run
gatsby build
. The error should pop up after the “open and validate gatsby-configs” step
Environment
Output of gatsby info --clipboard
:
System:
OS: Linux 4.15 Ubuntu 18.04.5 LTS (Bionic Beaver)
CPU: (4) x64 Intel(R) Core(TM) i3-7100U CPU @ 2.40GHz
Shell: 4.4.20 - /bin/bash
Binaries:
Node: 14.12.0 - /usr/bin/node
npm: 6.14.8 - /usr/bin/npm
Languages:
Python: 2.7.17 - /usr/bin/python
Browsers:
Firefox: 81.0
npmPackages:
gatsby: ^2.24.67 => 2.24.67
gatsby-plugin-styled-components: ^3.3.14 => 3.3.14
npmGlobalPackages:
gatsby-cli: 2.12.107
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Troubleshooting Common Errors - Gatsby
Issues with fs resolution. You may see this error because you're attempting to use fs inside a React component. Additionally, it often shows...
Read more >Gatsby Changelog | 5.3.0
In PR #36623 we fixed this behavior and any node changes (either by changing local files or through webhook updates) will be reflected...
Read more >gatsby-plugin-styled-components - npm
A Gatsby plugin for styled-components with built-in server-side rendering support. Install. npm install gatsby-plugin-styled-components styled- ...
Read more >Error: The result of this StaticQuery could not be fetched. This ...
If the root of your Gatsby application is packages/ventures then Gatsby will not extract GraphQL queries from packages/shared-ui , even if ...
Read more >How to Update Gatsby from v2 to v3 - YouTube
Gatsby released version 3. This big change can affect how future and current builds operate. I'll show you how to safely update Gatsby...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
To resolve this issue, please upgrade to the latest version of the
gatsby
packageThe reason y’all are seeing this error is because Gatsby validates that only known APIs are exported from
gatsby-node.js
, even for plugins you use in your sites. We addedpluginOptionsSchema
as a known API and have started adding it to our core plugins.When you upgraded the plugin packages to later versions, they exported the new
pluginOptionsSchema
API. However, when you don’t upgrade thegatsby
package at the same time, it is not yet marked as a known API.I’m very sorry for the troubles. 🙏 Let me know if upgrading the
gatsby
package to the latest version does not resolve this issue, which would be a bug.Upgrading to
v2.30.1
did not fix the problem. This is a great feature but I’m not able to use it. Either something in the documentation is missing or maybe it is a bug.My context of the issue is slightly different but I’m guessing the source of the problem is the same.
pluginOptionsSchema
. Other APIs ingatsby-node.js
work fine.I follow this guide to use
pluginOptionsSchema
API in my local remark transformer plugin.Sidenote: Some inputs for making the documentation better. Can we add extra info in each API doc page to mention the version when the API was introduced? Example : Mongodb docs - it features this info on top of each components docs in this way
New in version 3.4