Show actual error message when loading plugin fails #3083
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When attempting to develop a local plugin, I took https://github.com/zeit/hyperpower as a starting point, and cloned it into my local
.hyper_plugins/local
. I then added it to mylocalPlugins
, and launched the dev app withyarn run dev
, however as I didn't have hyperpower's dependencies installed, it could not berequire
d and it errored.Confusingly, however, the message was
which confused me because that directory did exist. Requiring that path, I saw the true error:
After I ran
npm install
from that directory, the error went away, but since I was confused by the error, I think it'd be helpful to show the actual error rather than handling all MODULE_NOT_FOUND errors with the message "Plugin ... not found."By applying this update, the true error will be clear:
I'm not tied to the wording I used - maintainers feel free to edit.