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
Property right of AssignmentExpression expected node to be of a type ["Expression"] but instead got null #8284
Comments
Hey @moafim! We really appreciate you taking the time to report an issue. The collaborators If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack |
Would you be able to provide a sample file that reproduces the issue? |
@loganfsmyth Unfortunately I can't |
You don't necessarily need to provide your actual production code, but you could trim it down to figure out exactly what decorator is causing the issue, then you could make an example without your original code. |
@loganfsmyth I think it's about @inject('stores')
@observer
class ServiceScreen extends Component {
@observable gender = this.props.stores.gender;
constructor(props) {
super(props);
} |
Hmm actually, I didn't see that you'd edited the original issue to be specific to Babel 7.x. On Babel 7's beta, |
@loganfsmyth I've install |
@moafim I don't know if this will apply in your case, but I was getting the same error, with all the dependencies in my package.json at the latest versions (7.0.0-beta.54 for the babel stuff, 5.0.2 for babel-preset-react-native, etc.). When I ran |
@moafim A little more information: I tried building a new app with |
@jjd314 re: babylon, it was renamed to @babel/parser in beta.48 |
@jjd314 Thank you for helping me (finally) successfully update to 0.56! Between that and the @babel/parser fix that existentialism mentioned, I'm back on track. |
@swcisel Would you be able to |
@moafim Here they are. I'm not sure what state they are in currently, because I tried some more stuff after my last post. I hope they help. package.json
.babelrc
|
@jjd314 as @thientnc-ibl mentioned, you must make sure your In the case of |
@existentialism Thanks, but the problem is that the decorators don't work in 47. Forcing it to 54 gets the decorators working, but I hit other problems. It looks like plugin-transform-classes is generating the _inherits calls for subclasses before doing pushBody(), which generates _createClass, which overrides the prototype. The effect is that any properties and methods defined in the subclass are lost. The immediate symptom is that I get a red box complaining that my component does not define render. I'm just waiting now for react-native to catch up to the latest babel, and hoping that everything gets resolved. |
@jjd314 cool, just wanted to clarify since a lot of RN users are having issues with the beta version mismatch stuff! |
No changes? Did someone actually resolve this? |
@PrsRares , Did you try my suggestion? it is posted at facebook/react-native#20150 |
@thientnc-ibl Ijust found out that they cant resolve this issue, so they will release 0.57 a little earlier and will be fixed, its a problem on windows only from what i was reading. Look here facebook/react-native#19953 |
@PrsRares I think you are totally wrong, this is not only a windows problem, it happens on macOs too. |
Aggregating the suggestions from @existentialism and @jjd314 (thanks for those btw!), the following fixed the issue for me: Install @babel/plugin-proposal-decorators specifically at version 7.0.0-beta.47:
Change the plugins in .babelrc as follows: {
"presets": ["react-native"],
"plugins": [
["@babel/plugin-proposal-decorators", { "legacy": true }]
]
} |
BUMP. I installed RN today so I have version 0.56. Wanting to create a new app that uses MobX, tried doing exactly what @liranh85 did, but I still get the following error:
So... This is really frustrating. Already spent a day on it. As far as I understand, the problem is that this version of |
I found the solution in another issue: #7831 before:
after:
|
I can confirm that this you can use MobX with decorators in RN 0.56 with Also it seems that even if you get MobX 5 to work, you can't use the |
package.json
.babelrc
I getting error |
It works with
|
any update of this issue guys? |
Doesn't #8284 (comment) work for you? Anyway, the last version of RN supports Babel 7. |
Nothing, we have RN 0.56, so we need to update before to try that solution :/ |
If you still encounter the problem - make sure that all your dependencies using babel are upgraded and do not use babel beta < 47. In my case, there was a problem with Thank you @jjd314! |
Thanks to everyone who suggested how to solve this problem. I'm closing this now since it is working with the last versions of the various packages. |
Bug Report
Current Behavior
React-Native App on Both iOS and Android got the Error:
bundling failed: TypeError: Property right of AssignmentExpression expected node to be of a type ["Expression"] but instead got null
Input Code
Expected behavior/code
Run App As Before
Babel Configuration (.babelrc, package.json, cli command)
Environment
Possible Solution
I don't have any suggestions
Additional context/Screenshots
No Screenshots
The text was updated successfully, but these errors were encountered: