Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed to work with RN 0.58+ #307

Merged
merged 6 commits into from
Jan 30, 2019
Merged

Fixed to work with RN 0.58+ #307

merged 6 commits into from
Jan 30, 2019

Conversation

Eugnis
Copy link
Contributor

@Eugnis Eugnis commented Jan 27, 2019

Starting from RN 0.58 commit DeltaPatcher: better support for the new Delta format react-native-debugger stopped working with error, look issue #292
This PR fixes #292, checked on Windows.

@jhen0409 jhen0409 self-requested a review January 27, 2019 12:14
@RWOverdijk
Copy link

Gave it a run, and first glance it works for me.

@wvmitchell
Copy link

wvmitchell commented Jan 30, 2019

Confirmed works for me on OSX 10.14.2. Nice catch @Eugnis!

RN 0.58.3
Xcode 10.1

Copy link
Owner

@jhen0409 jhen0409 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I'll release it as soon as possible, and sorry for delay.

@jhen0409 jhen0409 merged commit 977a5eb into jhen0409:master Jan 30, 2019
@mrTuomoK
Copy link

mrTuomoK commented Jan 30, 2019

So this this should now work? I'm creating a new project --> react-native init xxx and then running in the iOS simulator... then debugging remotely gives me this error which was thought to be fixed?

"react": "16.6.3",
"react-native": "0.58.3"

Xcode Version 10.1 (10B61)

Any ideas? Or is the fix still on it's way?

UPDATE --> I installed React Native Debugger and everything works now... So is it Chrome to blame?

2nd update --> still when debugging I sometimes get "Unable to find module for DevLoadingView" in the simulator when debugging... disappears after refresh

@hatemalimam
Copy link

Thanks for the update, as @mrTuomoK has mentioned, sometimes we are getting Unable to find module for DevLoadingView after a refresh it disappears, any idea about that ?

@Eugnis
Copy link
Contributor Author

Eugnis commented Jan 31, 2019

Can you open new issue with this error and screenshot or stack trace if present? I'm unable to reproduce this exception on my setup.
On first sight this PR not related to this error but there might be another changes in RN 0.58 so error appeared.

@rmilejcz
Copy link

rmilejcz commented Jan 31, 2019

I'm still getting this error on 0.58.3

Uncaught (in promise) TypeError: Iterator value v is not an entry object
    at new Map (<anonymous>)
    at deltaUrlToBlobUrl

Dependencies:

"react-native": "0.58.3"
"react":"16.7.0"

Error is here:

    const deltaPatcher = client.applyDelta({
      id: bundle.id,
      pre: new Map(bundle.pre), // <-- fails here
      post: new Map(bundle.post),
      delta: new Map(bundle.delta),
      reset: bundle.reset,
    });

I assume I'm doing something incorrect so I'm posting here, but if not I will open an issue on the rn repo. Caveat is that I'm also using TypeScript, my rn-cli.config.js:

var config = {
  getTransformModulePath() {
    return require.resolve('react-native-typescript-transformer');
  },
  getSourceExts() {
    return ['ts', 'tsx'];
  },
};
module.exports = config;

And I am running the package manager manually

cd $PROJECT_ROOT && react-native start --config $PROJECT_ROOT/rn-cli.config.js --reset-cache

@mrTuomoK
Copy link

mrTuomoK commented Feb 1, 2019

More info again on this.... Tried to change my simulator device and at least iPhone 7 Plus works perfectly.... but when using for example iPhone XR the problem comes up again

@Eugnis
Copy link
Contributor Author

Eugnis commented Feb 1, 2019

@rmilejcz

Error is here:

    const deltaPatcher = client.applyDelta({
      id: bundle.id,
      pre: new Map(bundle.pre), // <-- fails here
      post: new Map(bundle.post),
      delta: new Map(bundle.delta),
      reset: bundle.reset,
    });

Hello, seems you're using old version of react-native-debugger before fix. In current release this code is changed

const deltaPatcher = client.applyDelta(isOld ? {
id: bundle.id,
pre: new Map(bundle.pre),
post: new Map(bundle.post),
delta: new Map(bundle.delta),
reset: bundle.reset,
} : bundle);

@rmilejcz
Copy link

rmilejcz commented Feb 1, 2019

I'm a bit confused then, do I need to update react-native-debugger myself? I've deleted and reinstalled node-modules but I still seem to have the old version. For now I guess I will just make this change myself, thanks for the clarification!

@Eugnis
Copy link
Contributor Author

Eugnis commented Feb 1, 2019

@rmilejcz That's not only that file changed, here's all changes of this PR
Btw, you can better download react-native-debugger from releases which is already several versions above

@rmilejcz
Copy link

rmilejcz commented Feb 1, 2019

@Eugnis oh okay that's embarrassing, I was using chrome to debug instead of the standalone. With the standalone debugger everything works great. Thanks for your help!

cryptodev523 pushed a commit to cryptodev523/react-native-debugger that referenced this pull request Jan 27, 2022
* Fixed to work with RN 0.58+

* Removed unused import for new patcher

* Fixed to pass eslint check

* Fixed to work with both <0.58 and >0.58

* fixed typo

* fixed typo jhen0409#2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cannot debug react-native@0.58.0-rc.0 project
7 participants