Skip to content

RequestError is not exported #3121

@r-thomson

Description

@r-thomson

Describe the bug
The RequestError class is no longer exported, although it still appears in the type declaration. This bug was introduced in version 1.803.0.

To Reproduce
With "type": "module":

import { RequestError } from "@bigcommerce/checkout-sdk";
import { RequestError } from "@bigcommerce/checkout-sdk";
         ^^^^^^^^^^^^
SyntaxError: Named export 'RequestError' not found. The requested module '@bigcommerce/checkout-sdk' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

With "type": "commonjs":

const { RequestError } = require("@bigcommerce/checkout-sdk");

console.log(RequestError);

Logs undefined.

Expected behavior
RequestError should be available as a top-level export to avoid breaking changes.

Desktop (please complete the following information):

  • OS: N/A
  • Browser N/A
  • Version N/A

Smartphone (please complete the following information):

  • Device: N/A
  • OS: N/A
  • Browser N/A
  • Version N/A

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions