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

React-Native 0.57 Release build crashes on launch with undefined is not a function from a babelHelpers method. #21180

Closed
bzeeman opened this issue Sep 18, 2018 · 7 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@bzeeman
Copy link

bzeeman commented Sep 18, 2018

Environment

React Native Environment Info:
System:
OS: macOS 10.14
CPU: x64 Intel(R) Core(TM) i7-4960HQ CPU @ 2.60GHz
Memory: 734.07 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.5.0 - ~/.nvm/versions/node/v10.5.0/bin/node
Yarn: 1.9.4 - /usr/local/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v10.5.0/bin/npm
Watchman: 4.7.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0
Android SDK:
Build Tools: 19.1.0, 23.0.1, 23.0.2, 23.0.3, 24.0.1, 25.0.0, 25.0.1, 25.0.2, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.2
API Levels: 18, 19, 21, 22, 23, 24, 25, 26, 27, 28
IDEs:
Android Studio: 3.1 AI-173.4907809
Xcode: 10.0/10A255 - /usr/bin/xcodebuild
npmPackages:
@storybook/react-native: latest => 3.4.11
@types/react: latest => 16.4.14
@types/react-native: latest => 0.56.22
react: 16.5.2 => 16.5.2
react-native: 0.57.0
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7

Description

Babel 7 has cause some major headaches for us. Because the Google Play store requires new apps to be built against API26 or higher, we had to upgrade from a working build on 55.4 to piles of issues with 0.56+.

After solving issues with decorators, Mobx, and a variety of other issues everything seems to work great now, until we make a release build. Then we get a crash because babelHelpers seems to be missing things. Attached below is the logcat output for android.
E/ReactNativeJS: undefined is not a function (evaluating 'babelHelpers.applyDecoratedDescriptor(t.prototype,"notificationsEnabled",[Ve.serializable],{configurable:!0,enumerable:!0,writable:!0,initializer:null})') 09-17 12:32:48.301 11704-11758/? E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules Process: com.***********, PID: 11704 com.facebook.react.common.JavascriptException: undefined is not a function (evaluating 'babelHelpers.applyDecoratedDescriptor(t.prototype,"notificationsEnabled",[Ve.serializable],{configurable:!0,enumerable:!0,writable:!0,initializer:null})'), stack: <unknown>@820:1833

Also here is the output on iOS
2018-09-18 18:44:26.571 [error][tid:com.facebook.react.JavaScript] babelHelpers.applyDecoratedDescriptor is not a function. (In 'babelHelpers.applyDecoratedDescriptor(t.prototype,"recoveryKey",[me.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:null})', 'babelHelpers.applyDecoratedDescriptor' is undefined) 2018-09-18 18:44:26.572288-0600 LimbicArcApp[7865:1820384] babelHelpers.applyDecoratedDescriptor is not a function. (In 'babelHelpers.applyDecoratedDescriptor(t.prototype,"recoveryKey",[me.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:null})', 'babelHelpers.applyDecoratedDescriptor' is undefined) 2018-09-18 18:44:26.573 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: babelHelpers.applyDecoratedDescriptor is not a function. (In 'babelHelpers.applyDecoratedDescriptor(t.prototype,"recoveryKey",[me.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:null})', 'babelHelpers.applyDecoratedDescriptor' is undefined) 2018-09-18 18:44:26.573160-0600 LimbicArcApp[7865:1820364] Unhandled JS Exception: babelHelpers.applyDecoratedDescriptor is not a function. (In 'babelHelpers.applyDecoratedDescriptor(t.prototype,"recoveryKey",[me.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:null})', 'babelHelpers.applyDecoratedDescriptor' is undefined)

Here is my package.json:
{ "name": "LimbicArcApp", "version": "0.0.1", "private": true, "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start", "test": "jest", "storybook": "storybook start -p 7007", "ios": "react-native run-ios", "android": "react-native run-android" }, "dependencies": { "@babel/plugin-proposal-decorators": "^7.0.0", "@babel/polyfill": "^7.0.0", "@babel/runtime": "^7.0.0", "@types/react-native-push-notification": "^3.0.2", "appcenter": "^1.8.1", "appcenter-analytics": "^1.8.1", "appcenter-crashes": "^1.8.1", "color": "^3.0.0", "enzyme": "^3.6.0", "es6-symbol": "^3.1.1", "eslint-plugin-react-native": "^3.3.0", "firebase": "^5.5.0", "install": "^0.12.0", "javascript-state-machine": "^3.1.0", "jsc-android": "224109.x.x", "lodash": "^4.17.10", "lodash.isequal": "^4.5.0", "mobx": "^4.4.1", "mobx-react": "^5.2.8", "mobx-react-devtools": "^5.0.1", "moment": "^2.22.2", "native-base": "^2.8.0", "npm": "^6.1.0", "prop-types": "^15.6.2", "react": "16.5.2", "react-base": "^0.2.0", "react-native": "0.57.0", "react-native-elements": "^0.19.1", "react-native-email-link": "^1.1.0", "react-native-event-listeners": "^1.0.3", "react-native-layout-debug": "^1.1.1", "react-native-modal": "^6.5.0", "react-native-modal-datetime-picker": "^6.0.0", "react-native-modal-selector": "0.0.29", "react-native-orientation-loading-overlay": "^0.1.4", "react-native-page-control": "^1.1.1", "react-native-push-notification": "^3.1.1", "react-native-router-flux": "^4.0.1", "react-native-simple-store": "^1.3.0", "react-native-swipable": "0.0.2", "react-native-swipeable": "^0.6.0", "react-native-textinput-effects": "^0.4.2", "react-native-vector-icons": "^5.0.0", "react-navigation": "^2.14.2", "serializr": "^1.3.0", "util": "^0.11.0" }, "devDependencies": { "@babel/cli": "^7.1.0", "@babel/core": "^7.1.0", "@babel/plugin-transform-runtime": "^7.1.0", "@babel/preset-env": "^7.1.0", "@storybook/addon-actions": "latest", "@storybook/addon-links": "latest", "@storybook/addons": "latest", "@storybook/react-native": "latest", "@types/jest": "^23.1.2", "@types/react": "latest", "@types/react-native": "latest", "@types/react-test-renderer": "latest", "eslint": "^4.19.1", "eslint-config-airbnb": "^16.1.0", "eslint-plugin-babel": "^5.1.0", "eslint-plugin-import": "^2.12.0", "eslint-plugin-jsx-a11y": "^6.0.3", "eslint-plugin-react": "^7.9.1", "jest": "22.4.4", "prettier": "1.13.5", "react-addons-test-utils": "^15.6.2", "react-dom": "16.3.1", "react-native-typescript-transformer": "^1.2.10", "react-test-renderer": "16.3.1", "ts-jest": "^22.4.6", "typescript": "^3.0.1" }, "jest": { "preset": "react-native", "moduleFileExtensions": [ "ts", "tsx", "js" ], "transform": { "^.+\\.(js)$": "<rootDir>/node_modules/babel-jest", "\\.(ts|tsx)$": "<rootDir>/node_modules/ts-jest/preprocessor.js" }, "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", "testPathIgnorePatterns": [ "\\.snap$", "<rootDir>/node_modules/" ], "cacheDirectory": ".jest/cache", "setupFiles": [ "./node_modules/appcenter/test/AppCenterMock.js", "./node_modules/appcenter-analytics/test/AppCenterAnalyticsMock.js", "./node_modules/appcenter-crashes/test/AppCenterCrashesMock.js", "<rootDir>/node_modules/appcenter/test/AppCenterMock.js", "<rootDir>/node_modules/appcenter-crashes/test/AppCenterCrashesMock.js", "<rootDir>/node_modules/appcenter-analytics/test/AppCenterAnalyticsMock.js" ] }, "rnpm": { "assets": [ "./assets/fonts/" ] } }

And .bablerc
{ "plugins": [[ "@babel/plugin-proposal-decorators", { "legacy": true } ]], "presets": ["module:metro-react-native-babel-preset"] }

@react-native-bot
Copy link
Collaborator

It looks like you are using an older version of React Native. Please update to the latest release, v0.57 and verify if the issue still exists.

The ":rewind:Old Version" label will be removed automatically once you edit your original post with the results of running react-native info on a project using the latest release.

@bzeeman
Copy link
Author

bzeeman commented Sep 19, 2018

No react-native-bot, 0.57.0 is in fact 0.57.0...

@chussum
Copy link

chussum commented Sep 19, 2018

i have same issue..

@SkylineJia
Copy link

i 've come up with a workaround.
#20150 (comment)

@kelset
Copy link
Collaborator

kelset commented Sep 19, 2018

Please refer to #19955 (comment)

@kelset kelset closed this as completed Sep 19, 2018
@shinriyo
Copy link

shinriyo commented Oct 4, 2018

me too. release build

2018-10-04 22:43:08.073 [error][tid:com.facebook.react.JavaScript] undefined is not a function (near '...babelHelpers.applyDecoratedDescriptor...')

close? it has bug yet.

@ghost
Copy link

ghost commented Nov 24, 2018

Can this be reopened, facing exactly the same issue as @bzeeman
bump +1

@facebook facebook locked as spam and limited conversation to collaborators Nov 26, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Sep 19, 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.
Projects
None yet
Development

No branches or pull requests

6 participants