Skip to content

[Bug] Runtime Error: (ecmascript)}.createContext) is not a function #656

@bennajah

Description

@bennajah

Library used

react-paypal-js: ^8.8.3

🐞 Describe the Bug

Runtime TypeError (ecmascript)}.createContext) is not a function

🔬 Minimal Reproduction

  1. create next app using npx create-next-app@latest --use-pnpm
  2. install react-paypal-js package using pnpm add @paypal/react-paypal-js
  3. add <PayPalScriptProvider> to root layout file
  4. run pnpm dev
  5. visit http://localhost:3000/

😕 Actual Behavior

when run dev server getting this error
Image

🤔 Expected Behavior

A clear and concise description of what you expected to happen.

🌍 Environment

Operating System:
Platform: win32
Arch: x64
Version: Windows 11 Pro
Available memory (MB): 12244
Available CPU cores: 8
Binaries:
Node: 22.17.1
npm: 10.9.2
Yarn: N/A
pnpm: 10.13.1
Relevant Packages:
next: 15.4.4 // Latest available version is detected (15.4.4).
eslint-config-next: 15.4.4
react: 19.1.0
react-dom: 19.1.0
typescript: 5.8.3
Next.js Config:
output: N/A

➕ Additional Context

Add any other context about the problem here.

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