How to enable "JS minify" mode by using expo-cli


#1

I have upgraded my expo project from version 24 to 30, running in production mode is working fine, but running in the development mode, below error occurs.

[23:28:01] AnimatedRegion could not obtain AnimatedWithChildren base class
- node_modules\expo\src\logs\LogSerialization.js:173:9 in k
- node_modules\expo\src\logs\LogSerialization.js:19:0 in <unknown>
- node_modules\regenerator-runtime\runtime.js:65:31 in x
- node_modules\regenerator-runtime\runtime.js:297:16 in <unknown>
- node_modules\regenerator-runtime\runtime.js:117:15 in <unknown>
- node_modules\regenerator-runtime\runtime.js:65:31 in x
- node_modules\regenerator-runtime\runtime.js:154:42 in r
- node_modules\regenerator-runtime\runtime.js:729:36 in <unknown>
- node_modules\promise\setimmediate\core.js:43:0 in s
- node_modules\promise\setimmediate\core.js:198:0 in w
- node_modules\promise\setimmediate\core.js:63:13 in l
- node_modules\regenerator-runtime\runtime.js:729:36 in o
- node_modules\regenerator-runtime\runtime.js:729:36 in _invoke
- node_modules\regenerator-runtime\runtime.js:117:15 in <unknown>
- node_modules\regenerator-runtime\runtime.js:242:39 in async
- node_modules\expo\src\logs\LogSerialization.js:19:0 in serializeLogDataAsync
- node_modules\expo\src\logs\RemoteLogging.js:56:38 in <unknown>
- node_modules\regenerator-runtime\runtime.js:65:31 in x
- node_modules\regenerator-runtime\runtime.js:297:16 in <unknown>
- node_modules\regenerator-runtime\runtime.js:117:15 in <unknown>
- node_modules\regenerator-runtime\runtime.js:65:31 in x
- node_modules\regenerator-runtime\runtime.js:154:42 in r
- node_modules\regenerator-runtime\runtime.js:729:36 in <unknown>
- node_modules\promise\setimmediate\core.js:43:0 in s
- node_modules\promise\setimmediate\core.js:198:0 in w
- node_modules\promise\setimmediate\core.js:63:13 in l
- node_modules\regenerator-runtime\runtime.js:729:36 in o
- node_modules\regenerator-runtime\runtime.js:729:36 in _invoke
- node_modules\regenerator-runtime\runtime.js:117:15 in <unknown>
- node_modules\regenerator-runtime\runtime.js:242:39 in async
- node_modules\expo\src\logs\RemoteLogging.js:39:0 in enqueueRemoteLogAsync
- node_modules\expo\src\logs\RemoteConsole.js:116:4 in t
- node_modules\expo\src\logs\RemoteConsole.js:97:10 in <unknown>
- node_modules\react-native\Libraries\ReactNative\YellowBox.js:68:17 in error
- node_modules\react-native-maps\lib\components\AnimatedRegion.js:6:36 in <unknown>
- node_modules\metro\src\lib\polyfills\require.js:214:4 in d
- node_modules\metro\src\lib\polyfills\require.js:148:11 in a
- node_modules\metro\src\lib\polyfills\require.js:132:2 in o
- node_modules\react-native-maps\index.js:9:9 in <unknown>
- node_modules\metro\src\lib\polyfills\require.js:214:4 in d
- node_modules\metro\src\lib\polyfills\require.js:148:11 in a
- node_modules\metro\src\lib\polyfills\require.js:132:2 in o
- node_modules\expo\src\Expo.js:125:47 in MapView
* src\boot\setup.js:10:0 in _
* src\boot\setup.js:2:12 in <unknown>
- node_modules\metro\src\lib\polyfills\require.js:214:4 in d
- node_modules\metro\src\lib\polyfills\require.js:148:11 in a
- node_modules\metro\src\lib\polyfills\require.js:132:2 in o
* src\boot\index.js:5:1 in <unknown>
- node_modules\metro\src\lib\polyfills\require.js:214:4 in d
- node_modules\metro\src\lib\polyfills\require.js:148:11 in a
- node_modules\metro\src\lib\polyfills\require.js:132:2 in o
* null:null in <unknown>
- node_modules\metro\src\lib\polyfills\require.js:214:4 in d
- node_modules\metro\src\lib\polyfills\require.js:148:11 in a
- node_modules\metro\src\lib\polyfills\require.js:132:2 in o
- node_modules\react-native-scripts\build\bin\crna-entry.js:5:13 in <unknown>
- node_modules\metro\src\lib\polyfills\require.js:214:4 in d
- node_modules\metro\src\lib\polyfills\require.js:141:20 in a
- node_modules\metro\src\lib\polyfills\require.js:132:2 in o
* null:null in global code

[23:28:05] You are currently using minified code outside of NODE_ENV === 'production'. This means that you are running a slower development build of Redux. You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) to ensure you have the correct code for your production build.
- node_modules\expo\src\logs\LogSerialization.js:173:9 in k
- node_modules\expo\src\logs\LogSerialization.js:19:0 in <unknown>
- node_modules\regenerator-runtime\runtime.js:65:31 in x
- node_modules\regenerator-runtime\runtime.js:297:16 in <unknown>
- node_modules\regenerator-runtime\runtime.js:117:15 in <unknown>
- node_modules\regenerator-runtime\runtime.js:65:31 in x
- node_modules\regenerator-runtime\runtime.js:154:42 in r
- node_modules\regenerator-runtime\runtime.js:729:36 in <unknown>
- node_modules\promise\setimmediate\core.js:43:0 in s
- node_modules\promise\setimmediate\core.js:198:0 in w
- node_modules\promise\setimmediate\core.js:63:13 in l
- node_modules\regenerator-runtime\runtime.js:729:36 in o
- node_modules\regenerator-runtime\runtime.js:729:36 in _invoke
- node_modules\regenerator-runtime\runtime.js:117:15 in <unknown>
- node_modules\regenerator-runtime\runtime.js:242:39 in async
- node_modules\expo\src\logs\LogSerialization.js:19:0 in serializeLogDataAsync
- node_modules\expo\src\logs\RemoteLogging.js:56:38 in <unknown>
- node_modules\regenerator-runtime\runtime.js:65:31 in x
- node_modules\regenerator-runtime\runtime.js:297:16 in <unknown>
- node_modules\regenerator-runtime\runtime.js:117:15 in <unknown>
- node_modules\regenerator-runtime\runtime.js:65:31 in x
- node_modules\regenerator-runtime\runtime.js:154:42 in r
- node_modules\regenerator-runtime\runtime.js:729:36 in <unknown>
- node_modules\promise\setimmediate\core.js:43:0 in s
- node_modules\promise\setimmediate\core.js:198:0 in w
- node_modules\promise\setimmediate\core.js:63:13 in l
- node_modules\regenerator-runtime\runtime.js:729:36 in o
- node_modules\regenerator-runtime\runtime.js:729:36 in _invoke
- node_modules\regenerator-runtime\runtime.js:117:15 in <unknown>
- node_modules\regenerator-runtime\runtime.js:242:39 in async
- node_modules\expo\src\logs\RemoteLogging.js:39:0 in enqueueRemoteLogAsync
- node_modules\expo\src\logs\RemoteConsole.js:116:4 in t
- node_modules\expo\src\logs\RemoteConsole.js:97:10 in <unknown>
- node_modules\react-native\Libraries\ReactNative\YellowBox.js:68:17 in error
- node_modules\redux\lib\utils\warning.js:13:47 in default
- node_modules\redux\lib\index.js:38:102 in <unknown>
- node_modules\metro\src\lib\polyfills\require.js:214:4 in d
- node_modules\metro\src\lib\polyfills\require.js:148:11 in a
- node_modules\metro\src\lib\polyfills\require.js:132:2 in o
- node_modules\react-redux\lib\connect\mapDispatchToProps.js:6:8 in <unknown>
- node_modules\metro\src\lib\polyfills\require.js:214:4 in d
- node_modules\metro\src\lib\polyfills\require.js:148:11 in a
- node_modules\metro\src\lib\polyfills\require.js:132:2 in o
- node_modules\react-redux\lib\connect\connect.js:13:28 in <unknown>
- node_modules\metro\src\lib\polyfills\require.js:214:4 in d
- node_modules\metro\src\lib\polyfills\require.js:148:11 in a
- node_modules\metro\src\lib\polyfills\require.js:132:2 in o
- node_modules\react-redux\lib\index.js:10:31 in <unknown>
- node_modules\metro\src\lib\polyfills\require.js:214:4 in d
- node_modules\metro\src\lib\polyfills\require.js:148:11 in a
- node_modules\metro\src\lib\polyfills\require.js:132:2 in o
* src\boot\setup.js:3:0 in <unknown>
- node_modules\metro\src\lib\polyfills\require.js:214:4 in d
- node_modules\metro\src\lib\polyfills\require.js:148:11 in a
- node_modules\metro\src\lib\polyfills\require.js:132:2 in o
* src\boot\index.js:5:1 in <unknown>
- node_modules\metro\src\lib\polyfills\require.js:214:4 in d
- node_modules\metro\src\lib\polyfills\require.js:148:11 in a
- node_modules\metro\src\lib\polyfills\require.js:132:2 in o
* null:null in <unknown>
- node_modules\metro\src\lib\polyfills\require.js:214:4 in d
- node_modules\metro\src\lib\polyfills\require.js:148:11 in a
- node_modules\metro\src\lib\polyfills\require.js:132:2 in o
- node_modules\react-native-scripts\build\bin\crna-entry.js:5:13 in <unknown>
- node_modules\metro\src\lib\polyfills\require.js:214:4 in d
- node_modules\metro\src\lib\polyfills\require.js:141:20 in a
- node_modules\metro\src\lib\polyfills\require.js:132:2 in o
* null:null in global code

Any suggestion? Thanks.

My package.json is

{
  "name": "PICC",
  "version": "1.1.0",
  "private": true,
  "devDependencies": {
    "babel-eslint": "8.1.0",
    "eslint": "4.14.0",
    "eslint-plugin-flowtype": "2.40.1",
    "eslint-plugin-import": "2.8.0",
    "eslint-plugin-jsx-a11y": "^6.0.2",
    "eslint-plugin-prettier": "2.4.0",
    "eslint-plugin-react": "7.5.1",
    "eslint-plugin-react-native": "3.2.0",
    "flow-bin": "0.62.0",
    "flow-typed": "2.2.3",
    "husky": "0.14.3",
    "jest-expo": "^30.0.0",
    "react-native-scripts": "^1.14.0",
    "react-test-renderer": "16.2.0"
  },
  "main": "node_modules/react-native-scripts/build/bin/crna-entry.js",
  "scripts": {
    "start": "react-native-scripts start",
    "eject": "react-native-scripts eject",
    "android": "react-native-scripts android",
    "ios": "react-native-scripts ios",
    "test": "yarn jest && flow && eslint .",
    "jest": "node node_modules/jest/bin/jest.js",
    "precommit": "yarn test"
  },
  "jest": {
    "preset": "jest-expo",
    "transformIgnorePatterns": [
      "node_modules/(?!(react-native|lottie-react-native|expo|react-native-maps|react-native-svg|react-native-branch|native-base-shoutem-theme|react-native-easy-grid|react-native-drawer|react-native-vector-icons|react-native-keyboard-aware-scroll-view|react-navigation|native-base|@expo|react-native-scrollable-tab-view)/)"
    ]
  },
  "dependencies": {
    "es6-symbol": "^3.1.1",
    "expo": "^30.0.0",
    "form-urlencoded": "^3.0.0",
    "lodash": "4.17.4",
    "md5": "^2.2.1",
    "native-base": "^2.5.1",
    "react": "16.3.1",
    "react-native": "https://github.com/expo/react-native/archive/sdk-30.0.0.tar.gz",
    "react-native-datepicker": "^1.7.2",
    "react-native-message-bar": "^2.0.10",
    "react-native-popup-dialog": "^0.15.0",
    "react-native-simple-dialogs": "^0.3.1",
    "react-native-table-component": "^1.1.8",
    "react-navigation": "^2.9.3",
    "react-redux": "5.0.6",
    "redux": "3.7.2",
    "redux-actions": "^2.4.0",
    "redux-form": "^7.4.2",
    "redux-persist": "5.4.0",
    "redux-saga": "^0.16.0",
    "remote-redux-devtools": "0.5.0",
    "remote-redux-devtools-on-debugger": "^0.8.0"
  }
}

#2

I just wanna to say, yarn is a good thing :wink:


closed #3

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.