Closed coding-pangolin256 closed 6 years ago
Looks like you are trying to use a module in node_modules that is JSX?
university\node_modules\react-file-viewer\src\components\file-viewer.jsx
exclude: /node_modules/
but babel-loader is excluding it so it doesn't read it, you'll need to make an exception for that package in that regex (whitelist or blacklist)
I tried exclude: /node_modules\/(?!(react-file-viewer)\/).*/
but new errors occurred.
ERROR in ./~/react-csv/index.js
Module build failed: ReferenceError: Unknown plugin "transform-class-properties" specified in "E:\\code-bucket\\university\\node_modules\\react-csv\\.babelrc" at 4, attempted to resolve relative to "E:\\code-bucket\
\university\\node_modules\\react-csv"
at E:\code-bucket\university\node_modules\babel-core\lib\transformation\file\options\option-manager.js:180:17
at Array.map (<anonymous>)
at Function.normalisePlugins (E:\code-bucket\university\node_modules\babel-core\lib\transformation\file\options\option-manager.js:158:20)
at OptionManager.mergeOptions (E:\code-bucket\university\node_modules\babel-core\lib\transformation\file\options\option-manager.js:234:36)
at OptionManager.init (E:\code-bucket\university\node_modules\babel-core\lib\transformation\file\options\option-manager.js:368:12)
at File.initOptions (E:\code-bucket\university\node_modules\babel-core\lib\transformation\file\index.js:212:65)
at new File (E:\code-bucket\university\node_modules\babel-core\lib\transformation\file\index.js:135:24)
at Pipeline.transform (E:\code-bucket\university\node_modules\babel-core\lib\transformation\pipeline.js:46:16)
at transpile (E:\code-bucket\university\node_modules\babel-loader\lib\index.js:46:20)
at Object.module.exports (E:\code-bucket\university\node_modules\babel-loader\lib\index.js:163:20)
@ ./client/js/CourseEnrollmentCard.js 35:16-36
ERROR in ./~/react-upload-file/dist/index.min.js
Module build failed: Error: Couldn't find preset "stage-0" relative to directory "E:\\code-bucket\\university\\node_modules\\react-upload-file"
at E:\code-bucket\university\node_modules\babel-core\lib\transformation\file\options\option-manager.js:293:19
at Array.map (<anonymous>)
at OptionManager.resolvePresets (E:\code-bucket\university\node_modules\babel-core\lib\transformation\file\options\option-manager.js:275:20)
at OptionManager.mergePresets (E:\code-bucket\university\node_modules\babel-core\lib\transformation\file\options\option-manager.js:264:10)
at OptionManager.mergeOptions (E:\code-bucket\university\node_modules\babel-core\lib\transformation\file\options\option-manager.js:249:14)
at OptionManager.init (E:\code-bucket\university\node_modules\babel-core\lib\transformation\file\options\option-manager.js:368:12)
at File.initOptions (E:\code-bucket\university\node_modules\babel-core\lib\transformation\file\index.js:212:65)
at new File (E:\code-bucket\university\node_modules\babel-core\lib\transformation\file\index.js:135:24)
at Pipeline.transform (E:\code-bucket\university\node_modules\babel-core\lib\transformation\pipeline.js:46:16)
at transpile (E:\code-bucket\university\node_modules\babel-loader\lib\index.js:46:20)
at Object.module.exports (E:\code-bucket\university\node_modules\babel-loader\lib\index.js:163:20)
@ ./client/js/TeacherPresentationCard.js 21:23-51
ERROR in ./~/react-file-download/file-download.js
Module build failed: ReferenceError: [BABEL] E:\code-bucket\university\node_modules\react-file-download\file-download.js: Using removed Babel 5 option: E:\code-bucket\university\node_modules\react-file-download\.bab
elrc.stage - Check out the corresponding stage-x presets http://babeljs.io/docs/plugins/#presets
at Logger.error (E:\code-bucket\university\node_modules\babel-core\lib\transformation\file\logger.js:41:11)
at OptionManager.mergeOptions (E:\code-bucket\university\node_modules\babel-core\lib\transformation\file\options\option-manager.js:220:20)
at OptionManager.init (E:\code-bucket\university\node_modules\babel-core\lib\transformation\file\options\option-manager.js:368:12)
at File.initOptions (E:\code-bucket\university\node_modules\babel-core\lib\transformation\file\index.js:212:65)
at new File (E:\code-bucket\university\node_modules\babel-core\lib\transformation\file\index.js:135:24)
at Pipeline.transform (E:\code-bucket\university\node_modules\babel-core\lib\transformation\pipeline.js:46:16)
at transpile (E:\code-bucket\university\node_modules\babel-loader\lib\index.js:46:20)
at Object.module.exports (E:\code-bucket\university\node_modules\babel-loader\lib\index.js:163:20)
@ ./client/js/TeacherPresentationCard.js 37:19-49
Yep reading the error it's trying to read the babelrc of node_modules node_modules\\react-csv\\.babelrc
Should I copy the react-file-viewer module outside of node_modules?
I have the same issue on MacOS. For windows, it works fine. https://github.com/shystruk/create-react-redux-app-structure/blob/master/webpack.config.js
entry: [
'babel-polyfill', './app/app.jsx'
],
exclude: /node_modules\/(?!(app)\/).*/
I'm triaging old issues on babel-loader. Since this has been inactive for ages, I'm going to close it. Feel free to re-open if there's still something to discuss, but I'm assuming at this point it's been too long to address in a useful way.
Webpack Version: 1.15.0
Babel Core Version: 6.4.5
Babel Loader Version: 6.4.1
Windows 10
Current behavior:
webpack.config.js
package.json