Skip to content

Next 15: Cannot read properties of undefined (reading 'ReactCurrentDispatcher') #85

@magoz

Description

@magoz

Expected Behavior

P5-wrapper next to work on next 15.

Actual Behavior

Getting this error:

Screenshot 2025-01-06 at 16 49 18

Doing some research, it seems like this error pops up when there is a mismatch between react and react-dom versions:
https://stackoverflow.com/a/78667959

Running with or without Turbopack didn't make a difference.
Downgrading to Next 14 doesn't have the same issue.

Steps to Reproduce the Problem

  1. pnpx create-next-app@latest
  2. pnpm add @p5-wrapper/next @p5-wrapper/react
  3. Add example component from the readme.
    4.pnpm dev

Specifications

Package Version: 1.0.3

{
  "name": "p5-wrapper-next",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev ",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@p5-wrapper/next": "^1.0.3",
    "@p5-wrapper/react": "^4.4.2",
    "next": "15.1.3",
    "react": "^19.0.0",
    "react-dom": "^19.0.0"
  },
  "devDependencies": {
    "@eslint/eslintrc": "^3",
    "@types/node": "^20",
    "@types/react": "^19",
    "@types/react-dom": "^19",
    "eslint": "^9",
    "eslint-config-next": "15.1.3",
    "postcss": "^8",
    "tailwindcss": "^3.4.1",
    "typescript": "^5"
  }
}

Metadata

Metadata

Assignees

Labels

dependenciesIssues with or changes to dependenciesenhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions