You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a gatsby theme with a local plugin is installed into a project (or a co-located directory, using something like yarn workspaces) the gatsby build fails the load plugins step, claiming it cant find that local plugin and that it should be installed.
It's possible that this was never an intended use-case, but my current setup led to this particular issue.
run yarn workspace gatsby-theme-test to install packages
run yarn workspace gatsby-theme-test develop to see it successfully pass load plugins build step
run yarn workspace site to install packages (including gatsby-theme-test)
run yarn workspace site develop or cd site && gatsby develop to see it fail the load plugins build step displaying this error:
Expected result
Local plugin would be found in the installed theme directory and build should pass
Actual result
Local plugin was not found and this error was thrown:
ERROR
UNHANDLED REJECTION Unable to find plugin "gatsby-local-plugin". Perhaps you need to install its package?
Error: Unable to find plugin "gatsby-local-plugin". Perhaps you need to install its package?
- load.js:109 resolvePlugin
[test-gatsby-theme]/[gatsby]/dist/bootstrap/load-plugins/load.js:109:11
...
We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!
Thanks for being a part of the Gatsby community! 💪💜
themes intentionally don't support local plugins. If they did we would have to cut it off at some arbitrary point anyway since it could lead to recursive requiring of sub-local plugins when we merge local theme support. Since you're already using workspaces, I'd suggest moving the local plugin out to it's own package in the workspace.
If you feel strongly that local plugins in themes should be supported feel free to open a feature request detailing your use case and we can have a discussion there about potentially supporting it :)
Description
When a gatsby theme with a local plugin is installed into a project (or a co-located directory, using something like
yarn
workspaces) the gatsby build fails theload plugins
step, claiming it cant find that local plugin and that it should be installed.It's possible that this was never an intended use-case, but my current setup led to this particular issue.
Steps to reproduce
yarn workspace gatsby-theme-test
to install packagesyarn workspace gatsby-theme-test develop
to see it successfully passload plugins
build stepyarn workspace site
to install packages (including gatsby-theme-test)yarn workspace site develop
orcd site && gatsby develop
to see it fail the load plugins build step displaying this error:Expected result
Local plugin would be found in the installed theme directory and build should pass
Actual result
Local plugin was not found and this error was thrown:
Environment
The text was updated successfully, but these errors were encountered: