Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Error on starting expo with rnCliPath in app.json #57

Closed
orlov-vo opened this issue Sep 29, 2018 · 1 comment
Closed

Error on starting expo with rnCliPath in app.json #57

orlov-vo opened this issue Sep 29, 2018 · 1 comment
Labels
outdated question Further information is requested

Comments

@orlov-vo
Copy link

I trying to migrate to expo 2.0 but I have .jsx extensions for files (it is shared code with web project). But I can't start expo with rnCliPath variable in app.json for loading my rn-cli.config.js

// rn-cli.config.js
module.exports = {
  getSourceExts: () => ['jsx', 'js'],
};

PS: also I have this error with empty module.exports

Expected Behavior

It would start without errors with supporting import of jsx files

Observed Behavior

I have the error on start with env-var EXPO_DEBUG=true

> expo start

[15:34:01] Starting project at /Users/user/test/packages/mobile
[15:34:05] Metro Bundler process exited with code 0
[15:34:05] Error: Metro Bundler process exited with code 0
    at ChildProcess.<anonymous> (/xdl@51.4.0/src/Project.js:1472:14)
    at Generator.next (<anonymous>)
    at step (/usr/local/lib/node_modules/expo-cli/node_modules/xdl/build/Project.js:2033:191)
    at /usr/local/lib/node_modules/expo-cli/node_modules/xdl/build/Project.js:2033:437
    at new Promise (<anonymous>)
    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/expo-cli/node_modules/xdl/build/Project.js:2033:99)
    at ChildProcess.packagerProcess.once (/xdl@51.4.0/src/Project.js:1470:5)
    at Object.onceWrapper (events.js:273:13)
    at ChildProcess.emit (events.js:182:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)

Environment

  OS: macOS High Sierra 10.13.6
  Node: 10.7.0
  Yarn: 1.9.2
  npm: 6.4.0
  Watchman: 4.9.0
  Xcode: Xcode 10.0 Build version 10A255
  Android Studio: Not Found

Packages: (wanted => installed)
  expo: ^30.0.1 => 30.0.1
  react: 16.3.1 => 16.3.1
  react-native: https://github.com/expo/react-native/archive/sdk-30.0.0.tar.gz => 0.55.4

Diagnostics report:
-[15:45:43] Request failed with status code 500```
@fson
Copy link
Contributor

fson commented Oct 2, 2018

Hey, rnCliPath is something different, it's used to override the location of the React Native local CLI executable (node_modules/react-native/local-cli/cli.js by default). In practice you never have to set it.

To set the path of the config file for Metro, you can use packagerOpts.config. However, if all you need is to set the sourceExts configuration, you can specify it in packagerOpts directly, like this:

// app.json
{
  // ...
  "packagerOpts": { "sourceExts": ["jsx", "js"] }
}

@fson fson closed this as completed Oct 2, 2018
@fson fson added the question Further information is requested label Oct 2, 2018
@lock lock bot added the outdated label Jul 1, 2019
@lock lock bot locked and limited conversation to collaborators Jul 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants