React-native: Unhandled JS Exception: Invariant Violation: Module name prefixes should've been stripped by the native side but wasn't for RCTJSCExecutor

Created on 27 Oct 2016  路  23Comments  路  Source: facebook/react-native

We use GitHub Issues for bugs.

If you have a non-bug question, ask on Stack Overflow: http://stackoverflow.com/questions/tagged/react-native

If you have a feature request, post it on Product Pains: https://productpains.com/product/react-native/

--- Please use this template, and delete everything above this line before submitting your issue ---

Description

After upgrading to 0.36 I got this only: Unhandled JS Exception: Invariant Violation: Module name prefixes should've been stripped by the native side but wasn't for RCTJSCExecutor

Reproduction

rn: 0.36
react: 15.3.1

Additional Information

  • React Native version: 0.36
  • Platform: IOS
  • Operating System: MacOS
Locked

Most helpful comment

I use 0.36.1, but the problem is still @brentvatne

All 23 comments

I have the same issue rn: 0.36 and react: 15.0.2

I also have the same issue after upgrading to .36. I fixed changing the AppDelegate.m

from this:

jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];

to this:

jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];

Thanks @manelpb. And how do you revert to production then?

@valinaga because i'm using codepush for production it's not a problem for me, but i hope they will fix this issue soon.

#ifdef DEBUG
    jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
    //jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
#else
    jsCodeLocation = [CodePush bundleURL];
#endif

I have this issue only with "jest":

react-native init testApp
cd testApp
jest

It is also an issue on jest https://github.com/facebook/jest/issues/1912

Same issue here =(

This is fixed now!

I use 0.36.1, but the problem is still @brentvatne

Sorry for adding few reactions. I reseted the content and settings from the iOS simulator (using 0.36.1) and the problem is not present anymore. It was really strange, since the requested URLs to the packager were same with both using a localhost hardcoded url and also the provider.

I'm still seeing this issue when running a release build.

I got development working by changing this:

// jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
to this

jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];

For release builds I'm using react-native-code-push version 1.15.0-beta.

React native 37
React 15.2.0

Getting this when running using the cli. react-native run-ios always launches the simulator and this is the first message that comes up. I uninstalled/reinstalled react-native-cli globally, but this didn't help either. Everything is up-to-date I think.

I tried tried simulators with iOS 9.1 and 10.1.

However, I do not get the error if I build directly from Xcode (using 8.1).

Same issue with:

  • React native 0.37
  • React 15.3.1

Have tried:

  • deleting /node_modules
  • Reset content ... in Simulator

Other info:

  • Xcode project builds from both Xcode & CLI

Works if I run the project from Xcode, but not CLI.

Updated an existing project from RN 0.32 to 0.37 and it no longer runs.

Not sure if it's even loading the right app up via the CLI as the app running via the CLI contains the default starting screen, not my app's.

I got it working again after regenerating the xcode project when running "react-native upgrade". I also reinstalled all node_modules and pod deps. I'm pretty sure (but not 100%) regenerating the xcode project was the main thing.

@siderakis thanks for the idea.
Tried that, then ended up getting "Unrecognized font family 'Lato-Black'" error on run.
Will continue to investigate, but currently spending more time troubleshooting the tooling than getting client work done :-(

using RN 0.38, problem still there :(

pod install solved it for me :)

陌 couldn't find a solution, yet the issue is closed. @brentvatne

After i updated to 0.39, i started to get this error if i try to run my app from Xcode or my iPhone. However, when i run it from terminal with "react-native run-ios" it works fine.

Just throwing my experience into this bucket. I had similar issues during a RN upgrade (0.35 -> 0.39). I had to run a full "Clean Build Folder..." (Product...Hold down Option...Clean Build Folder) in order to clear out the old binaries. We also had some npm module changes, so I had already run a full rm -rf node_modules && npm install (or yarn install if you're a cool kid, I suppose).

HTH

I managed to solve this by going in and deleting Pod-created .a files from the main Products/Release-iphoneos folder. Then rebuilding. Looks like leftovers from a previous folder structure.

same problem in 0.42.0 version

still having this problem.

"react": "~15.4.0",
"react-native": "^0.41.0",

I've done react-native upgrade, Clean Build Folder, clear node_modules and npm install etc but no luck.

I used 'Deco' and had this problem, then I tried CLI and solved it.

Still have this issue after updating my React / React-native dependencies

"react": "^16.0.0",
"react-dom": "^16.0.0",
"react-native": "^0.48.4"

Was this page helpful?
0 / 5 - 0 ratings