-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
avoid the default is not a function unclear error (#438)
if there is some issue evaluating a lazy loaded edge function its default export ends up not being a function and that results in an unhelpful error like the following: ``` TypeError: u.default is not a function ``` slightly improve the user experience by catching such error and letting the user know that something went wrong with the edge function's evaluation: ``` Error: An error occurred while evaluating the target edge function (<edge-function-path>) ```
- Loading branch information
1 parent
c788def
commit cb32baf
Showing
2 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
'@cloudflare/next-on-pages': patch | ||
--- | ||
|
||
avoid the default is not a function unclear error | ||
|
||
if there is some issue evaluating a lazy loaded edge function | ||
its default export ends up not being a function and that results | ||
in an unhelpful error like the following: | ||
|
||
``` | ||
TypeError: u.default is not a function | ||
``` | ||
|
||
slightly improve the user experience by catching such error and | ||
letting the user know that something went wrong with the edge | ||
function's evaluation: | ||
|
||
``` | ||
Error: An error occurred while evaluating the target edge function (<edge-function-path>) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters