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

Unable to find local plugin from installed theme #16128

Closed
bensbigolbeard opened this issue Jul 26, 2019 · 2 comments
Closed

Unable to find local plugin from installed theme #16128

bensbigolbeard opened this issue Jul 26, 2019 · 2 comments
Labels
stale? Issue that may be closed soon due to the original author not responding any more.

Comments

@bensbigolbeard
Copy link

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 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.

Steps to reproduce

  1. clone this example repo
  2. run yarn workspace gatsby-theme-test to install packages
  3. run yarn workspace gatsby-theme-test develop to see it successfully pass load plugins build step
  4. run yarn workspace site to install packages (including gatsby-theme-test)
  5. 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
  ...

Environment

  System:
    OS: macOS High Sierra 10.13.6
    CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 10.16.0 - ~/n/bin/node
    Yarn: 1.17.3 - ~/n/bin/yarn
    npm: 6.9.0 - ~/n/bin/npm
  Languages:
    Python: 2.7.10 - /usr/bin/python
  Browsers:
    Chrome: 75.0.3770.80
    Safari: 12.1.1
@gatsbyjs gatsbyjs deleted a comment from gatsbot bot Jul 26, 2019
@gatsbot gatsbot bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Aug 16, 2019
@gatsbot
Copy link

gatsbot bot commented Aug 16, 2019

Hiya!

This issue has gone quiet. Spooky quiet. 👻

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! 💪💜

@ChristopherBiscardi
Copy link
Contributor

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale? Issue that may be closed soon due to the original author not responding any more.
Projects
None yet
Development

No branches or pull requests

2 participants