nativescript-community / react-native-in-nativescript

Experiments to generate NativeScript bindings to React Native
Apache License 2.0
2 stars 0 forks source link

ReactReconciler is not a function #2

Open Lelelo1 opened 3 years ago

Lelelo1 commented 3 years ago

ReactReconciler is not a function

..which currently comes from running the demo-react project on ios.


I tried running the it with uninstalling react-native and found the below error. I have no idea if they are related yet, maybe ReactReconciler is not a function is triggered by it, but being altered with rn somehow?

TypeError: (0 , _pathType.isDirectorySync) is not a function in

fork-ts-checker-webpack-plugin/node_modules/cosmiconfig/dist/getDirectory.js:28:61

function getDirectorySync(filepath) {
  const filePathIsDirectory = (0, _pathType.isDirectorySync)(filepath); // <--

  if (filePathIsDirectory === true) {
    return filepath;
  }

  const directory = _path.default.dirname(filepath);

  return directory;
}
shirakaba commented 3 years ago

If you pull the latest commit on the haul branch, I worked around the ReactReconciler problem. I wasn’t able to determine why, but I did characterise the exact problem.

When I bundle both React Native and React NativeScript (which pulls in React Reconciler) into the same bundle, although React Reconciler clearly enters the bundle, React NativeScript fails to import it at runtime. It might be that React Native is poisoning it somehow.

To work around it, I gave up on mixing RNS with RN. I’m focusing on trying to run a complete RN app in a vanilla NativeScript app now (still in the demo-react project, though).

I’m stuck even on that, though. The moment I initialise an instance of RCTBridge, the app just exits without writing any logs or providing a stack trace. I’ve been unable to learn any more :/

Lelelo1 commented 3 years ago

Did we ever do a successful log on iOS? Is the native iOS rn accessible without making any changes?

I am noticing when I comment out the custom AppDelegate.tsand start the app like in the rns sample the ReactReconciler is not function error comes back and it is without calling any rn