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

fix: module resolution returns early and accurate error messages on failure #534

Merged
merged 3 commits into from
Jun 20, 2023

Conversation

garethgeorge
Copy link
Contributor

The existing module resolution logic has two logic errors which create a confusing experience when the customer's module isn't found:

  1. null is never returned even when the module is not found, this means function framework doesn't early return with an exception when it should if the function does not exist.
  2. The error message will accurately reflect the original path instead of including /function.js prefix which gets incorporated as a side effect of the implementation today.

This change simplifies the function and cleans up these errors.

@garethgeorge garethgeorge force-pushed the garethgeorge/resolution branch from 57da792 to b0fe6a4 Compare May 23, 2023 00:18
@garethgeorge garethgeorge requested a review from guangyw June 6, 2023 20:09
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

Successfully merging this pull request may close these issues.

3 participants