-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Module build failed: TypeError: Property right of AssignmentExpression expected node to be of a type ["Expression"] but instead got null at Array.map (native) #7831
Comments
Hey @leejay1992! 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 |
Please fill the issue template |
Hi @leejay1992! A maintainer of the project has notified me that you're missing Please understand that we receive a high volume of issues, and there are only a limited number Please make sure you have the following information documented in this ticket:
Please provide either a link to the problem via the |
@leejay1992 I started seeing this error after upgrading my project to babel beta 46 (was previously on beta 44), and it seems it may indicate some conflict between babel plugins. In my case I was able to resolve it by removing |
Good Nice |
@cburbank's solution didn't work for me, but I was able to solve it by having the decorators plugin like this:
|
@somonek thanks for your comment-I've also resolved this issue by replacing the plugin: |
I am suffering from this issue in |
@dooboolab Did you manage to find a solution for this? |
@TitanKing No. I've wasted a day to solve this problem. What's funny is, it works ok when I use typescript. I feel like babel@7 is facing many issues currently. |
@dooboolab Yeah I cannot spend days trying to get past this. Oh well, reverting is the only option then I guess. Thanks for the feedback. |
I've also tried:
in my package.json and then: rm -rf node_modules/ yarn.lock && yarn but still doesn't work :/ |
Looks like this bug related with this commit: b8dcd6f The quick fix:
|
@dimapaloskin That is only a problem when you are using different versions of the various packages. |
You shouldn't use |
@TitanKing @dooboolab I found it, I found it, I found it! Righto - so metro bundler in react native 0.56 only supports babel 7 beta v47 Which means its actually due to a version mismatch, just not one in your package.json. I solved this by looking at the missing peer dependencies when running So what I did was package.json "devDependencies": {
"@babel/core": "7.0.0-beta.47",
"@babel/plugin-proposal-decorators": "7.0.0-beta.47",
"@babel/plugin-transform-runtime": "7.0.0-beta.47",
"@babel/runtime": "7.0.0-beta.47",
... .babelrc {
"presets": [
"react-native"
],
"plugins": [
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
[
"@babel/plugin-transform-runtime",
{
"helpers": true,
"polyfill": false,
"regenerator": false
}
]
]
} Note: I did need to remove @babel/parser as it was first introduced in beta 48 |
@rknell Thanks. My app is running now. However, there is another problem left for me which is jest. It works fine when I downgrade to
If you also face the build error in configuring
Thank you by the way with the |
I got the same error when adding Mobx support to my react native project. Changes suggested by @dooboolab above fixed this error for me. Am using "react-native": "^0.56.0". |
Yes. Downgrading to 0.47 version fixes the problem. I'm keeping dependencies as:
before babel 7 is stable for react native |
@mehulmpt just to clarify: “babel 7 is stable for react native”... it is, it’s just that all your @babel/* dependencies need to fixed to matching versions, and since RN is currently using beta47, you must too. |
Yeah, I meant to say "before we can do semver for babel 7 packages for react native" @existentialism |
@somonek s answer solved it for me: before:
after:
|
@rknell could you please share the whole package.json / .babelrc ? Thank you 🤗 |
@rborn - Can't let folks suffer... This is what I am having in my project to make Mobx work with React Native 0.56, hope this helps you all. .babelrc {
"presets": [
"react-native"
],
"plugins": [
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
]
]
} package.json {
"name": "MyProject",
"version": "0.0.1",
"dependencies": {
"@babel/plugin-proposal-decorators": "7.0.0-beta.47",
"@babel/runtime": "7.0.0-beta.47",
"add": "^2.0.6",
"axios": "^0.18.0",
"deep-object-diff": "^1.1.0",
"fast-json-patch": "^2.0.7",
"flat": "^4.1.0",
"lodash": "^4.17.10",
"mobx": "^5.0.3",
"mobx-react": "^5.2.3",
"react": "16.4.1",
"react-dom": "^16.4.1",
"react-native": "^0.56.0",
"react-native-code-push": "^5.4.1",
"react-native-country-picker-modal": "^0.6.2",
"react-native-firebase": "^4.3.7",
"react-native-form": "^2.1.2",
"react-native-gifted-chat": "^0.4.3",
"react-native-lightbox": "git://github.com/oblador/react-native-lightbox.git#0a37652",
"react-native-linear-gradient": "^2.4.0",
"react-native-loading-spinner-overlay": "^0.5.2",
"react-native-segmented-control-tab": "^3.2.2",
"react-native-text-input-enhance": "^1.0.11",
"react-native-typography": "^1.3.0",
"react-native-vector-icons": "^4.6.0",
"react-navigation": "^2.6.2",
"react-navigation-header-buttons": "^2.0.1",
"styled-components": "^3.3.3",
"uuid": "^3.3.2",
"yarn": "^1.9.4"
},
"devDependencies": {
"babel-jest": "23.4.0",
"babel-preset-react-native": "^5",
"flow-bin": "^0.76.0",
"jest": "^23.4.1",
"jsc-android": "^224109.0.0",
"react-native-cli": "^2.0.1",
"react-native-rename": "^2.2.2",
"react-test-renderer": "16.4.1"
},
"jest": {
"preset": "react-native"
}
}
|
@hvaoc I fixed like this: Alsop keep Thanks a lot for your help 🤗 |
Since no information were provided in the issue initially, I'm going to close this. Please feel free to re-open a new issue. |
Choose one: is this a bug report or feature request?
Input Code
Babel/Babylon Configuration (.babelrc, package.json, cli command)
Expected Behavior
Current Behavior
Possible Solution
Context
Your Environment
The text was updated successfully, but these errors were encountered: