Skip to content

HTTP imports not found error #41948

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    esmIssues and PRs related to the ECMAScript Modules implementation.feature requestIssues requesting new Node.js features.loadersIssues and PRs related to ES module loaders.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions