-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Crashes in Release mode on 0.56.0 #801
Comments
Same here, |
@jrnk You've got a much more precise stack trace than I, have you found a workaround? Wondering if it could be that https://github.com/oblador/react-native-vector-icons/blob/master/lib/create-icon-set.js#L40 this const is uppercase and babel (incorrectly) assumes this should be a class? I've had this problem with other non-class uppercase stuff since @babel 7, having to do stuff like:
This is preventing me from release at the moment :( |
@Amnesthesia not yet. Will post here if I do of course. |
@jrnk I find it strange that this hasn't been caught (or reported) already, since 0.56 has been out for a month already What does your |
|
Damn. Pretty much the same as mine, except I have |
@Amnesthesia found the culprit. |
@jrnk I'm already doing that — so that must be something else :( |
@Amnesthesia mm :( did you also remove |
@jrnk No! I didn't!! Oh my god please be that. I'm gonna give it a shot |
Holy shit! It works! Thank you @jrnk! If anybody else runs into this, this is what I've done: 1. Updated .babelrc to this: {
"env": {
"development": {
"presets": ["react-native", "@babel/preset-flow"],
"plugins": [
["@babel/plugin-proposal-decorators", { "legacy": true }],
"graphql-tag",
"@babel/plugin-proposal-object-rest-spread",
[
"@babel/plugin-transform-runtime",
{
"helpers": true,
"polyfill": false,
"regenerator": false
}
]
]
},
"production": {
"presets": ["react-native", "@babel/preset-flow"],
"plugins": [
["@babel/plugin-proposal-decorators", { "legacy": true }],
"graphql-tag",
"transform-remove-console"
]
}
}
} 2. package.json has this:
3. index.js import { AppRegistry } from 'react-native';
import applyDecoratedDescriptor from '@babel/runtime/helpers/es6/applyDecoratedDescriptor';
import initializerDefineProperty from '@babel/runtime/helpers/es6/initializerDefineProperty';
Object.assign(babelHelpers, {
applyDecoratedDescriptor,
initializerDefineProperty,
});
// RN 0.56 Release version crashes
// Workaround: RN 0.56 Release version crashes
// Sources:
// https://github.com/facebook/react-native/issues/19827
// https://github.com/facebook/react-native/issues/20150
AppRegistry.registerComponent(
'Coinalyze',
() => require('./App/Containers/App').default,
); |
OMG 🙀 @Amnesthesia @jrnk ❤️❤️❤️ I am trying to build for release for a RN 0.56 project with mobx decorators for two days now and your solution just worked!!! |
@rborn im trying to do the same since couple of days, and the release build is crashing. I have also raised an issue in mobx-react repo.
|
@fahidmohammad you need to have Alsop keep |
@rborn After updating the thank you so much for the help. |
Hi @rborn, thanks, it works now, but i've another problem. How do i do this with Higher Order Components? Here is my new code:
With this setup, i'm unable to access mobx stores, is there a way to use this and still access mobx stores with My previous index.js was like this and could access all the mobx stores set in './src/mobx'
@fahidmohammad where and how do you set your mobx stores? Thanks, |
@ungaro donno :( |
@ungaro im using router.js
/stores/index.js
/store/StoreItemA.js
index.js
But now i have another issue with MobX over React Navigation. The state management does not work properly with the above approach. Still digging a better approach. If anyone can suggest a better implementation modal, will be highly appreciated. |
@ungaro Can you show your .babelrc and package.json? The decision what was provided here #801 (comment) is not working for me - I'm using mobx too. |
I'm having some insanely strange bug, that I think is related to http://babeljs.io/docs/en/babel-plugin-transform-class-constructor-call being removed in @babel 7
I've spent all day trying to debug this, and it comes down to the icons. As soon as I remove all calls to
<Icon ... />
, the app works again.This is with:
Xcode: 9.4
OS: MacOS High Sierra
This happens on Android too, so this is most likely a problem with transpiling one way or another.
Icons are linked properly, and debug mode works fine. This is with all babel dependencies forced to 7.0.beta47. It crashes with the following message:
The text was updated successfully, but these errors were encountered: