Issue Summary
The CaptureStatus enum is not properly exported when using the @paypal/paypal-server-sdk package in an ESM project ("type": "module"), even though it IS defined in the source code.
Description
When using @paypal/paypal-server-sdk in an ESM project with "type": "module" in package.json, importing CaptureStatus fails with:
SyntaxError: The requested module '@paypal/paypal-server-sdk' does not provide an export named 'CaptureStatus'
However, the source code at src/index.ts line 97 clearly exports it:
export { CaptureStatus } from './models/captureStatus.js';
Environment
- SDK Version: 2.2.0
- Node.js Version: v24.12.0
- Package Manager: pnpm 10.28.1
- Module Type: ESM (
"type": "module" in package.json)
Code to Reproduce
// In an ESM project (package.json has "type": "module")
export { OrderStatus, CaptureStatus } from '@paypal/paypal-server-sdk';
Expected Behavior
Both OrderStatus and CaptureStatus should be importable from the package.
Actual Behavior
Only OrderStatus imports successfully. CaptureStatus throws:
SyntaxError: The requested module '@paypal/paypal-server-sdk' does not provide an export named 'CaptureStatus'
Analysis
The package's package.json defines:
{
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"exports": {
".": {
"import": {
"types": "./dist/esm/types/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/cjs/types/index.d.ts",
"default": "./dist/cjs/index.js"
}
}
}
}
The ESM build at dist/esm/index.js appears to be missing some exports that exist in the source. This could be a build configuration issue with tsconfig.esm.json or the build script.
Issue Summary
The
CaptureStatusenum is not properly exported when using the@paypal/paypal-server-sdkpackage in an ESM project ("type": "module"), even though it IS defined in the source code.Description
When using
@paypal/paypal-server-sdkin an ESM project with"type": "module"inpackage.json, importingCaptureStatusfails with:However, the source code at
src/index.tsline 97 clearly exports it:Environment
"type": "module"in package.json)Code to Reproduce
Expected Behavior
Both
OrderStatusandCaptureStatusshould be importable from the package.Actual Behavior
Only
OrderStatusimports successfully.CaptureStatusthrows:Analysis
The package's
package.jsondefines:{ "main": "dist/cjs/index.js", "module": "dist/esm/index.js", "exports": { ".": { "import": { "types": "./dist/esm/types/index.d.ts", "default": "./dist/esm/index.js" }, "require": { "types": "./dist/cjs/types/index.d.ts", "default": "./dist/cjs/index.js" } } } }The ESM build at
dist/esm/index.jsappears to be missing some exports that exist in the source. This could be a build configuration issue withtsconfig.esm.jsonor the build script.