next icon indicating copy to clipboard operation
next copied to clipboard

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

Open magoz opened this issue 10 months ago • 4 comments
trafficstars

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"
  }
}

magoz avatar Jan 06 '25 15:01 magoz

A post with more detail regarding what packages are causing issues here: https://stackoverflow.com/a/79350215/3668599

davidfitzgibbon avatar Jan 19 '25 12:01 davidfitzgibbon

Same thing happening for me!

danlesko avatar Feb 07 '25 06:02 danlesko

+1 , breaks with Next 15

sreyemnayr avatar Apr 07 '25 18:04 sreyemnayr

I was able to get the error to go away by removing @p5-wrapper/next, upgrading to the latest 5.x alpha of @p5-wrapper/react, and just creating the dynamic component myself by copying https://github.com/P5-wrapper/next/blob/master/src/main.tsx into my components directory and importing it from there.

sreyemnayr avatar Apr 07 '25 18:04 sreyemnayr

@sreyemnayr do you have a code example with packages ?

amapic avatar May 22 '25 05:05 amapic

@sreyemnayr do you have a code example with packages ?

You can have a look at my repo if you like: https://github.com/sreyemnayr/circle-of-fifths/blob/main/src/components/PlaylistArt.tsx

It’s a mess, but you can see what it’s using and swap out the locally defined wrapper with the package version and see if it still breaks. It requires a Spotify api key. I don’t really have time to create a simple reproduction at the moment, sorry!

sreyemnayr avatar May 22 '25 18:05 sreyemnayr

Sorry, i switched back to next 14, thanks for answering anyway and for the Package. I had thé basic set up créated by create next app with react 19 and next 15.

Le jeu. 22 mai 2025 à 20:45, Ryan @.***> a écrit :

sreyemnayr left a comment (P5-wrapper/next#85) https://github.com/P5-wrapper/next/issues/85#issuecomment-2902229631

@sreyemnayr https://github.com/sreyemnayr do you have a code example with packages ?

You can have a look at my repo if you like: https://github.com/sreyemnayr/circle-of-fifths/blob/main/src/components/PlaylistArt.tsx

It’s a mess, but you can see what it’s using and swap out the locally defined wrapper with the package version and see if it still breaks. It requires a Spotify api key. I don’t really have time to create a simple reproduction at the moment, sorry!

— Reply to this email directly, view it on GitHub https://github.com/P5-wrapper/next/issues/85#issuecomment-2902229631, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACE7NZED5Q5L5OGLRVHW25D27YLM7AVCNFSM6AAAAABUV3XXOKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSMBSGIZDSNRTGE . You are receiving this because you commented.Message ID: @.***>

amapic avatar May 22 '25 19:05 amapic

No pb, thx

Le jeu. 22 mai 2025 à 20:45, Ryan @.***> a écrit :

sreyemnayr left a comment (P5-wrapper/next#85) https://github.com/P5-wrapper/next/issues/85#issuecomment-2902229631

@sreyemnayr https://github.com/sreyemnayr do you have a code example with packages ?

You can have a look at my repo if you like: https://github.com/sreyemnayr/circle-of-fifths/blob/main/src/components/PlaylistArt.tsx

It’s a mess, but you can see what it’s using and swap out the locally defined wrapper with the package version and see if it still breaks. It requires a Spotify api key. I don’t really have time to create a simple reproduction at the moment, sorry!

— Reply to this email directly, view it on GitHub https://github.com/P5-wrapper/next/issues/85#issuecomment-2902229631, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACE7NZED5Q5L5OGLRVHW25D27YLM7AVCNFSM6AAAAABUV3XXOKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSMBSGIZDSNRTGE . You are receiving this because you commented.Message ID: @.***>

amapic avatar May 22 '25 19:05 amapic

No pb thx again

Le jeu. 22 mai 2025 à 20:45, Ryan @.***> a écrit :

sreyemnayr left a comment (P5-wrapper/next#85) https://github.com/P5-wrapper/next/issues/85#issuecomment-2902229631

@sreyemnayr https://github.com/sreyemnayr do you have a code example with packages ?

You can have a look at my repo if you like: https://github.com/sreyemnayr/circle-of-fifths/blob/main/src/components/PlaylistArt.tsx

It’s a mess, but you can see what it’s using and swap out the locally defined wrapper with the package version and see if it still breaks. It requires a Spotify api key. I don’t really have time to create a simple reproduction at the moment, sorry!

— Reply to this email directly, view it on GitHub https://github.com/P5-wrapper/next/issues/85#issuecomment-2902229631, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACE7NZED5Q5L5OGLRVHW25D27YLM7AVCNFSM6AAAAABUV3XXOKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSMBSGIZDSNRTGE . You are receiving this because you commented.Message ID: @.***>

amapic avatar May 22 '25 19:05 amapic

Try using version 2.0.0 and let me know how it goes. 👍🏻

jamesrweb avatar Jul 05 '25 00:07 jamesrweb