Skip to content

update path of react-native module #422

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

Closed

Conversation

markdowney
Copy link

@markdowney markdowney commented Apr 5, 2017

As of react-native 0.43, the main entry point of the package has been renamed (see: facebook/react-native@cf1bc8d).

This allows the library to work with RN-0.43 but will break on prior versions.

@thiagoghisi
Copy link

@markdowney I would love to see this change in the next parse version. Any idea what is going on? It looks like the broken build was removed from travis-ci.

@markdowney
Copy link
Author

Nope, no idea. But meanwhile, you can use the module from here:

  "dependencies": {
    ...
    "parse": "git+https://github.com/bakery/Parse-SDK-JS.git#release-1.10",
    ... 
  }

@flovilmart
Copy link
Contributor

@markdowney can we get a proper fix for both versions using require?

@markdowney
Copy link
Author

Not sure how you'd fixed this. I tried catching the error on require to fallback on the old version, as in:

let rnModule;
try {
    rnModule = require('react-native/Libraries/react-native/react-native-implementation.js');
} catch (err) {
    rnModule = require('react-native/Libraries/react-native/react-native.js');
}

but this won't work for react-native due to facebook/react-native#5079

@flovilmart
Copy link
Contributor

Not sure why they want to do it that way, but it's quite annoying as it's a transitive dependency, not a hard one. Does the try/catch solution work for you?

@markdowney
Copy link
Author

Nope, the try/catch will fail hard at compile time because of the issue mentioned above.

Not sure why but importing the "react-native" module returns an empty object. Maybe @andrewimm can enlighten us?

@flovilmart
Copy link
Contributor

React-native is not a dependency of the JS SDK, I believe that's why it returns an empty module

@markdowney
Copy link
Author

But adding it as a peerDependency should do the trick, shouldn't it?

@flovilmart
Copy link
Contributor

Perhaps :) worth having a look, problem is that it will probably force the version to the one in the peers dependencies.

@flovilmart
Copy link
Contributor

Closing as already addressed will land in 1.10.

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.

4 participants