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

Create a function which detects if require error is not MODULE_NOT_FOUND #1795

Closed
KyleAMathews opened this issue Aug 14, 2017 · 0 comments
Closed

Comments

@KyleAMathews
Copy link
Contributor

We often in Gatsby do try/catch around requiring userland code so that if the user hasn't provided that module, we can fallback on a default version of the module.

But this causes trouble if the user has some sort of code error in that module which causes the require to fail.

We should create a function which detects if there's errors in the user code and rethrow that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant