Provides a custom error for Node to combine CJS and ESM module not found errors.

Hierarchy

Constructors

  • Parameters

    • options: {
          code: string;
          message: string;
      }

      Options object.

      • code: string

        Error code.

      • message: string

        Error message.

    Returns ModuleLoadError

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void

Properties

cause?: unknown
code: string
message: string
name: string
stack?: string
prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

Optional override for formatting stack traces

stackTraceLimit: number