babel: Error: We don't know what to do with this node type. We were previously a Statement but we can't fit in here?
I’m reporting an error I get for every React component exported after I upgraded to @babel/*@^7.0.0-beta.37:
ERROR in ./apps/visitor/components/List.js
Module build failed: Error: We don't know what to do with this node type. We were previously a Statement but we can't fit in here?
I already checked this out https://github.com/babel/babel/issues/7122 where the problem was a version mismatch but it does not seem my case.
Babel config in package.json:
"babel": {
"presets": [
[
"@babel/preset-env",
{
"modules": false,
"useBuiltIns": "usage",
"debug": true
}
],
"@babel/preset-stage-0",
"@babel/preset-react"
],
"plugins": [
"lodash",
"@babel/plugin-proposal-decorators",
[
"@babel/plugin-proposal-class-properties",
{
"loose": true
}
]
]
},
Dependencies version:
"devDependencies": {
"@babel/core": "^7.0.0-beta.37",
"@babel/plugin-proposal-class-properties": "^7.0.0-beta.37",
"@babel/plugin-proposal-decorators": "7.0.0-beta.37",
"@babel/polyfill": "^7.0.0-beta.37",
"@babel/preset-env": "^7.0.0-beta.37",
"@babel/preset-react": "^7.0.0-beta.37",
"@babel/preset-stage-0": "^7.0.0-beta.37",
"babel-eslint": "8.2.1",
"babel-jest": "22.0.4",
"babel-loader": "8.0.0-beta.0",
"babel-minify-webpack-plugin": "0.2.0",
"babel-plugin-lodash": "3.3.2",
...
}
Thanks for the amazing work on this project as always 💪🏻
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 3
- Comments: 48 (11 by maintainers)
Commits related to this issue
- https://github.com/babel/babel/issues/7177 — committed to Kozea/webpackozea by paradoxxxzero 6 years ago
- Trying to remove @babel/plugin-transform-classes since babel/babel#7177 is closed. — committed to Kozea/webpackozea by paradoxxxzero 6 years ago
- fix(package): fix packging broken by babel regresssion prepping for 0.6.0 release, seems it's time to upgrade our babel deps. This change ended up fixing things: https://github.com/babel/babel/issues... — committed to qri-io/2017-frontend by b5 6 years ago
I’m getting this error message on my mobile app build with
react-native
0.56.0-rc.3 (react
16.4.1).First time I got this was on
react-native
0.56.0-rc.2, but then removingnode_modules
and installing all dependencies again was fixing it. Right not this workaround doesn’t work any more 😐Still seeing this in
7.0.0-beta.42
! Am I the only one using decorators and having this?Any news on this guys? 🙏🏻
For me, It worked when i changed from
export default class SomeClass extends React.Component { .... }
to
export default class SomeClass extends Component { .... }
Thanks a lot. I placed class-properties before decorators and it worked.
This is my configuration:
But the current document…
https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-decorators#note-compatibility-with-babelplugin-proposal-class-properties
We are currently working heavily on both the decorators and class-propertie transforms.
@damianobarbati thanks for continuing to follow this issue, and while it might seem it’s “being totally ignored”, it’s really just that the team has a number of things we are working on (including totally revamping the decorators transform itself).
It’s not that we don’t want to fix this, we will… and even better, welcome any contributions towards a fix.
Again, the issue is a plugin ordering one, and running class-properties before decorators should work.
Still having it in
7.0.0-beta.43
.Here the config as always just for reference:
Any chance on this @existentialism ?
I’m still seeing this with
Ok it turn out to be about
@babel/plugin-proposal-decorators
, got it working with the following versions: