Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

ESM Hooks: nextResolve & nextLoad can return promises which is not reflected in documentation #49282

Copy link
Copy link
@koshic

Description

@koshic
Issue body actions

Affected URL(s)

https://nodejs.org/dist/latest-v20.x/docs/api/esm.html#hooks

Description of the problem

image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to the documentations.Issues and PRs related to the documentations.esmIssues and PRs related to the ECMAScript Modules implementation.Issues and PRs related to the ECMAScript Modules implementation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.