我目前正在创建一个带有React前端的Rails应用程序。为此,我正在使用react_rails 和webpacker宝石。
现在,我已按照安装指南中的所有步骤添加了bootstrap。
现在,当我运行Rails Server Web Packer时,编译失败并且出现以下错误,
fromRequireContextWithGlobalFallback.js:21 Error: Module build failed (from ./node_modules/css-loader/dist/cjs.js):
ValidationError: CSS Loader Invalid Options
options should NOT have additional properties
at validateOptions (:3000/home/react-rails-demo_backup/node_modules/schema-utils/src/validateOptions.js:32)
at Object.loader (:3000/home/react-rails-demo_backup/node_modules/css-loader/dist/index.js:34)
at Object../node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js?!./node_modules/bootstrap/dist/css/bootstrap.css (index.js:55)
at __webpack_require__ (bootstrap:19)
at Object../node_modules/bootstrap/dist/css/bootstrap.css (bootstrap.css:2)
at __webpack_require__ (bootstrap:19)
at Module../app/javascript/components/Main.js (Header.js.jsx:25)
at __webpack_require__ (bootstrap:19)
at webpackContext (.*$:33)
at fromRequireContext.js:13
at Object.getConstructor (fromRequireContextWithGlobalFallback.js:15)
at Object.mountComponents (index.js:85)
如何解决此错误?