gpt4 book ai didi

ruby-on-rails - 启动 webpack-dev-server 时配置对象无效

转载 作者:行者123 更新时间:2023-12-01 10:19:18 25 4
gpt4 key购买 nike

我刚刚在 Rails 5.2 应用程序上安装了 webpacker,在尝试运行 bin/webpack-dev-server 时出现以下错误:

 ✖ 「wds」: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.entry should be one of these:
function | object { <key>: non-empty string | [non-empty string] } | non-empty string | [non-empty string]
-> The entry point(s) of the compilation.
Details:
* configuration.entry should be an instance of function
-> A Function returning an entry object, an entry string, an entry array or a promise to these things.
* configuration.entry should not be empty.
-> Multiple entry bundles are created. The key is the chunk name. The value can be a string or an array.
* configuration.entry should be a string.
-> An entry point without name. The string is resolved to a module which is loaded upon startup.
* configuration.entry should be an array:
[non-empty string]
关键应该在 configuration.entry should be one of these: function | object 中,但不完全知道这意味着什么......

最佳答案

问题是当我安装 webpacker ( rails webpacker:install ) 时,我显然已经有一个空的 app/javascript 文件夹,所以安装跳过了这些安装文件:

The JavaScript app source directory already exists



手动添加 app/javascript/packs/application.js 文件解决了这个问题。

关于ruby-on-rails - 启动 webpack-dev-server 时配置对象无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56170975/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com