【问题标题】:rails webpack-dev-server "Invalid configuration object"rails webpack-dev-server“无效的配置对象”
【发布时间】:2019-11-01 12:56:11
【问题描述】:

当我尝试运行 ./bin/webpack-dev-server 我得到这个:

Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration has an unknown property 'mode'. These properties are valid:
   object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry, externals?, loader?, module?, name?, node?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, stats?, target?, watch?, watchOptions? }
   For typos: please correct them.
   For loader options: webpack 2 no longer allows custom properties in configuration.
     Loaders should be updated to allow passing options via loader options in module.rules.
     Until loaders are updated one can use the LoaderOptionsPlugin to pass these options to the loader:
     plugins: [
       new webpack.LoaderOptionsPlugin({
         // test: /\.xxx$/, // may apply this only for some modules
         options: {
           mode: ...
         }
       })
     ]

我很确定这是与包版本混淆的纱线。我可以运行“重新安装所有内容”命令吗?

我的版本是

webpack-dev-server@3.4.1

@rails/webpacker@3.5.5

【问题讨论】:

  • 我遇到了同样的问题。你解决了吗?

标签: ruby-on-rails webpack webpack-dev-server


【解决方案1】:

很可能是 webpacker.yml 的问题。
就我而言,source_path 不正确。

看到这个:Invalid configuration object when starting webpack-dev-server

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-04-10
    • 2020-05-28
    • 2018-05-18
    • 2022-01-12
    • 2017-08-20
    • 2021-10-13
    • 2018-05-26
    • 1970-01-01
    相关资源
    最近更新 更多