You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But in the reality nextResolve (and nextLoad) can return Promises, which is highly confusing: as an example, try...catch around 'return nextResolve(...)' will never catch the error if nextResolve returns rejected Promise. The same thing with access to nextResolve(...) result properties.
In both cases await keyword is mandatory to get predictable results.
The text was updated successfully, but these errors were encountered:
Our linter complains if we do return await, because it’s unnecessary, so you might see code like return nextResolve(...). But I think our examples always await the next* call when we’re using the returned value.
@koshic What changes in the docs would make things more obvious to you? Would the changes discussed in #49265 (comment) have been sufficient?
Affected URL(s)
https://nodejs.org/dist/latest-v20.x/docs/api/esm.html#hooks
Description of the problem
But in the reality nextResolve (and nextLoad) can return Promises, which is highly confusing: as an example, try...catch around 'return nextResolve(...)' will never catch the error if nextResolve returns rejected Promise. The same thing with access to nextResolve(...) result properties.
In both cases await keyword is mandatory to get predictable results.
The text was updated successfully, but these errors were encountered: