jk-gan / flipper-plugin-redux-debugger

Flipper plugin for Redux in React Native
MIT License
117 stars 20 forks source link

Plugin flipper-plugin-redux-debugger failed to load Error: Cannot find module 'react' #67

Open hossamnasser938 opened 1 year ago

hossamnasser938 commented 1 year ago

I'm trying to integrate redux-flipper plugin But I'm getting the following error:

Screen Shot 2023-02-16 at 3 19 45 PM

I installed the plugin on flipper desktop app. I also installed redux-flipper: ^2.0.2 and react-native-flipper: ^0.162.0 into the app. I added the plugin to middleware array:

const createDebugger = require("redux-flipper").default
middlewares.push(createDebugger())

Could you help please?

plwai commented 1 year ago

May I know what is your flipper version?

hossamnasser938 commented 1 year ago

Sure Version 0.162.0 (50.0.0) @plwai

afonso-tsx commented 1 year ago

I have the same issue, running windows 11 flipper version 0.125

plwai commented 1 year ago

Can you try a newer version?

jvfalco1 commented 1 year ago

I'm having the same issue with this package.json

"react-native-flipper": "^0.162.0", "redux-flipper": "^2.0.1", "react-native": "0.67.5", "react": "17.0.2",

jk-gan commented 1 year ago

@hossamnasser938 @afonsopbarros @jvfalco1 is it possible to use the latest version of react-native-flipper and flipper desktop app and try again?

I tested on my machine with react-native-flipper 0.182.0 and flipper desktop app version 0.182.0, it works perfectly

"dependencies": {
    "@reduxjs/toolkit": "^1.9.3",
    "react": "18.1.0",
    "react-native": "0.70.6",
    "react-native-flipper": "^0.182.0",
    "react-redux": "^8.0.5",
    "redux-flipper": "^2.0.2"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@babel/runtime": "^7.12.5",
    "@react-native-community/eslint-config": "^2.0.0",
    "@tsconfig/react-native": "^2.0.2",
    "@types/jest": "^26.0.23",
    "@types/react": "^18.0.21",
    "@types/react-native": "^0.70.6",
    "@types/react-test-renderer": "^18.0.0",
    "@typescript-eslint/eslint-plugin": "^5.37.0",
    "@typescript-eslint/parser": "^5.37.0",
    "babel-jest": "^26.6.3",
    "eslint": "^7.32.0",
    "jest": "^26.6.3",
    "metro-react-native-babel-preset": "0.72.3",
    "react-test-renderer": "18.1.0",
    "typescript": "^4.8.3"
  }
Screenshot 2023-02-25 at 1 59 42 PM
jvfalco1 commented 1 year ago

@hossamnasser938 @afonsopbarros @jvfalco1 is it possible to use the latest version of react-native-flipper and flipper desktop app and try again?

I tested on my machine with react-native-flipper 0.182.0 and flipper desktop app version 0.182.0, it works perfectly

"dependencies": {
    "@reduxjs/toolkit": "^1.9.3",
    "react": "18.1.0",
    "react-native": "0.70.6",
    "react-native-flipper": "^0.182.0",
    "react-redux": "^8.0.5",
    "redux-flipper": "^2.0.2"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@babel/runtime": "^7.12.5",
    "@react-native-community/eslint-config": "^2.0.0",
    "@tsconfig/react-native": "^2.0.2",
    "@types/jest": "^26.0.23",
    "@types/react": "^18.0.21",
    "@types/react-native": "^0.70.6",
    "@types/react-test-renderer": "^18.0.0",
    "@typescript-eslint/eslint-plugin": "^5.37.0",
    "@typescript-eslint/parser": "^5.37.0",
    "babel-jest": "^26.6.3",
    "eslint": "^7.32.0",
    "jest": "^26.6.3",
    "metro-react-native-babel-preset": "0.72.3",
    "react-test-renderer": "18.1.0",
    "typescript": "^4.8.3"
  }
Screenshot 2023-02-25 at 1 59 42 PM

I've been trying to use the lastest versions too. Unfortunately, when I use flipper 0.182.0, it works perfectly on Android, but, when I try to use on iOS I get an error you can check at this ggithub issue link.

jk-gan commented 1 year ago

Just to be clear, are you using react-native-flipper v0.182.0 too?

jvfalco1 commented 1 year ago

Just to be clear, are you using react-native-flipper v0.182.0 too?

Yes, Im.

"react-native-flipper": "^0.182.0",
"redux-flipper": "^2.0.2",

Flipper Client: 0.182.0.

Podfile use_flipper!({ 'Flipper' => '0.182.0' })

@jk-gan

jk-gan commented 1 year ago

that's weird, the error occur when you using simulator or real iphone? or both?

jvfalco1 commented 1 year ago

Both, simulator and real phone.

jk-gan commented 1 year ago

@jvfalco1 I'm unable to reproduce the issue (at least on my machine), perhaps you can provide me a sample react-native project with that issue that I can take a look?

HugoGresse commented 1 year ago

Facing the same issue, I've updated:

And it works again

jk-gan commented 1 year ago

so the latest version of react-native-flipper is working nicely?

HugoGresse commented 1 year ago

for me yes, using RN 0.70.6 though

seb1080 commented 3 months ago

Thanks, I upgrade from Flipper v0.164.0 to v0.182.0 and the problem was resolve. I tested with a iOS physical device.

Error message

Plugin 'Redux Debugger' failed to load: 'Cannot find module 'react'
Require stack: - /Users/sblaisfernandez/.flipper/installed-plugins/flipper-plugin-redux-debugger/2.0.2/dist/bundle.js -
 /Applications/Flipper.app/Contents/Resources/app.asar/index.html'.

Set up causing the error

macOS: 14.4.1 (23E224) node -v v18.17.1 Flipper: 0.164.0

"react-native": "0.72.14", "react": "18.2.0", "redux-flipper": "1.4.2", "react-native-flipper": "0.164.0",

solution

Upgrade from Flipper v0.164.0 to v0.182.0