Skip to content

HTTP imports not found error #41948

@guybedford

Description

@guybedford

What is the problem this feature will solve?

When a 404 not found response is made for an HTTP/s import, the error thrown is currently:

Error [ERR_NETWORK_IMPORT_BAD_RESPONSE]: import 'https://h3manth.com/foo' received a bad response: HTTP response returned status code of 404

it might be useful to convert this into a full ERR_MODULE_NOT_FOUND error to properly match semantics in error handling code paths.

What is the feature you are proposing to solve the problem?

Return an ERR_MODULE_NOT_FOUND for 404 network errors in HTTP/s imports.

What alternatives have you considered?

Keeping it as a custom error or network not found error creates divergence between local and remote resolvers. It can be useful to streamline the error path handling by having a singular code to check.

Metadata

Metadata

Assignees

No one assigned

    Labels

    esmIssues and PRs related to the ECMAScript Modules implementation.feature requestIssues that request new features to be added to Node.js.loadersIssues and PRs related to ES module loadersstale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions