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

Updated to ReactNative 0.57 with index.[OS].js and not index.js #22645

Closed
wmonecke opened this issue Dec 14, 2018 · 3 comments
Closed

Updated to ReactNative 0.57 with index.[OS].js and not index.js #22645

wmonecke opened this issue Dec 14, 2018 · 3 comments
Labels
Resolution: Locked This issue was locked by the bot. Type: Invalid This issue does not belong here. Applying this label will cause issue to be closed.

Comments

@wmonecke
Copy link

wmonecke commented Dec 14, 2018

Environment

React Native Environment Info:
    System:
      OS: macOS 10.14.2
      CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
      Memory: 579.55 MB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 8.9.4 - /usr/local/bin/node
      npm: 5.6.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 11.2, macOS 10.13, tvOS 11.2, watchOS 4.2
      Android SDK:
        API Levels: 23, 25, 26, 27, 28
        Build Tools: 26.0.2, 26.0.3, 27.0.2, 27.0.3, 28.0.2
        System Images: android-P | Google APIs Intel x86 Atom
    IDEs:
      Android Studio: 3.1 AI-173.4720617
      Xcode: 9.2/9C40b - /usr/bin/xcodebuild
    npmPackages:
      react: ^16.6.3 => 16.6.3
      react-native: ^0.57.8 => 0.57.8
    npmGlobalPackages:
      create-react-native-app: 1.0.0
      react-native-cli: 2.0.1
      react-native-git-upgrade: 0.2.7

Description

When I started my react native project it was with react-native init (I am not 100% sure).
The .js entry files where index.android.js and also index.ios.js.

I recently updated from RN 0.47 to RN 0.57. And when running ./gradlew assembleRelease I encountered the following error:

The resource '/Users/waltermonecke/Documents/Code/React-Native/lisdoWorker/index.js' was not found.

Which is obvious because I have no index.js.
How do I deal with this? I dont want to mess up my project.

On iOS I was able to solve it since in the AppDelegate.m you can specify the js entry file like so:

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

However I have no idea how to do this on android.

Full Error Log

Error: The resource `/Users/waltermonecke/Documents/Code/React-Native/lisdoWorker/index.js` was not found.
    at /Users/waltermonecke/Documents/Code/React-Native/lisdoWorker/node_modules/metro/src/Server.js:348:15
    at Generator.next (<anonymous>)
    at step (/Users/waltermonecke/Documents/Code/React-Native/lisdoWorker/node_modules/metro/src/Server.js:70:30)
    at /Users/waltermonecke/Documents/Code/React-Native/lisdoWorker/node_modules/metro/src/Server.js:89:14
    at new Promise (<anonymous>)
    at /Users/waltermonecke/Documents/Code/React-Native/lisdoWorker/node_modules/metro/src/Server.js:67:12
    at Server._buildGraph (/Users/waltermonecke/Documents/Code/React-Native/lisdoWorker/node_modules/metro/src/Server.js:389:7)
    at /Users/waltermonecke/Documents/Code/React-Native/lisdoWorker/node_modules/metro/src/Server.js:218:38
    at Generator.next (<anonymous>)
    at step (/Users/waltermonecke/Documents/Code/React-Native/lisdoWorker/node_modules/metro/src/Server.js:70:30)
@sunnylqm
Copy link
Contributor

@sunnylqm
Copy link
Contributor

Actually for a big version update, I recommend to init a new project and move your js code to that new project instead of update.

@kelset
Copy link
Contributor

kelset commented Dec 14, 2018

👋 there.

As pointed out by @sunnylqm, what you are attempting is not a small update but instead a 10 versions jump. So many has changed since that simply bumping the version in the package.json won't have your project run RN 0.57.

I highly recommend that you head over the releases section of the repo to learn what changed since version 0.47, and attempt a more gradual update (one version at the time) OR, as suggested by Sunny, create a fresh new project and migrate your code into it.

We are aware that upgrading is still in a rough place for React Native, and we are actively investigating how to make it better here.

@kelset kelset closed this as completed Dec 14, 2018
@kelset kelset added the Type: Invalid This issue does not belong here. Applying this label will cause issue to be closed. label Dec 14, 2018
@facebook facebook locked as resolved and limited conversation to collaborators Dec 14, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Dec 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot. Type: Invalid This issue does not belong here. Applying this label will cause issue to be closed.
Projects
None yet
Development

No branches or pull requests

4 participants