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

Show actual error message when loading plugin fails #3083

Merged
merged 1 commit into from Sep 23, 2018
Merged

Show actual error message when loading plugin fails #3083

merged 1 commit into from Sep 23, 2018

Conversation

razzius
Copy link
Contributor

@razzius razzius commented Jun 13, 2018

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 my localPlugins, and launched the dev app with yarn run dev, however as I didn't have hyperpower's dependencies installed, it could not be required and it errored.

Confusingly, however, the message was

Plugin "hyperpower" not found: /Users/razzi/forks/hyper/.hyper_plugins/local/hyperpower

which confused me because that directory did exist. Requiring that path, I saw the true error:

$ node
> require('/Users/razzi/forks/hyper/.hyper_plugins/local/hyperpower')
Error: Cannot find module 'lodash.throttle'

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:

Plugin error while loading "hyperpower" (/Users/razzi/forks/hyper/.hyper_plugins/local/hyperpower): Cannot find module 'lodash.throttle'

I'm not tied to the wording I used - maintainers feel free to edit.

@Stanzilla Stanzilla added the 🎨 Type: Enhancement Issue or PR is an enhancement request/proposal for Hyper label Jun 24, 2018
@linonetwo
Copy link

When will this be merged? It's useful for debugging.

Copy link
Collaborator

@chabou chabou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you ! really better with your message

@chabou chabou merged commit 51db83c into vercel:canary Sep 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎨 Type: Enhancement Issue or PR is an enhancement request/proposal for Hyper
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants