Skip to content

@paypal/accelerated-checkout-loader: typescript is mis-declared as a runtime dependency #961

Description

@mohamedgomran

Summary

@paypal/accelerated-checkout-loader@1.2.1 lists typescript under dependencies, but TypeScript is a build-time tool only. It is already (correctly) present under devDependencies, so the runtime entry is a packaging mistake. This pulls a full typescript@^4.6.4 install into the dependency tree of every consumer that has no need for it at runtime.

Note: this package's npm metadata has no repository/bugs field and there is no dedicated public repo for the loader, so filing here as the documented catch-all for PayPal JS SDK issues.

Affected versions

  • 1.2.1 (current latest)
  • 2.0.0-beta.4 (prerelease) — same issue still present

Evidence

From the published package.json:

"dependencies": {
  "@braintree/asset-loader": "2.0.0",
  "envify": "^4.1.0",
  "typescript": "^4.6.4"   // <- build-time only, should not be here
},
"devDependencies": {
  // ...
  "typescript": "^4.6.4"   // <- already correctly declared here
}

Confirmed via npm view @paypal/accelerated-checkout-loader@1.2.1 dependencies and @2.0.0-beta.4.

I also verified the published runtime does not use TypeScript at all:

  • dist/loader.umd.js (the main entry), dist/loader.esm.js, and src/ contain no require('typescript') / import ... from 'typescript' references (nor tslib).
  • The only TS artifacts shipped are passive .d.ts declaration files, which do not require the typescript package at runtime.

Impact

  • Installs an unnecessary, large typescript package into consumers' node_modules and lockfiles.
  • Adds noise/bloat to dependency trees and audit/supply-chain surface for a package not used at runtime.

Suggested fix

Remove typescript from dependencies (it remains in devDependencies):

 "dependencies": {
   "@braintree/asset-loader": "2.0.0",
-  "envify": "^4.1.0",
-  "typescript": "^4.6.4"
+  "envify": "^4.1.0"
 },

Environment

  • @paypal/accelerated-checkout-loader: 1.2.1
  • Installed via npm

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions