react-dnd: Babel error -Using removed Babel 5 option
I am a babel newbie, I setup a new project, installed babel, installed react-dnd via bower and my .babelrc has the following line
{ "presets": ["es2015", "stage-0", "react"] }
Module build failed: ReferenceError:
[BABEL] <path>\bower_components\react-dnd\src\index.js: Using removed Babel 5 option: <path>\bower_components\react-dnd\.babelrc.stage - Check out the corresponding stage-x presets http://babeljs.io/docs/plugins/#presets
What am i doing wrong
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 4
- Comments: 16 (2 by maintainers)
@walter0331
This should be a thing.
Ahhh, I fixed it by excluding
node_modulesin webpack.conf 👯Just to clarify, I think everyone means “babel-loader” rather than “babe-loader”.
@ry928330 basically, the
disposableslib is used inreact-dnd, anddisposablesuses an outdated babel version, Babel 5 (this library isn’t maintained). If included in the webpack configuration, it creates a conflict because we are now on the version 6 of Babel. So the better solution here ( at least what worked for me), is not necessarily to exclude all node_modules, but only the conflicting one.add
exclude: /(disposables)/in your babel-loader webpack config, for instance:I fixed by add []
presets: [ ["es2015", { loose: false }] ]