gpt4 book ai didi

webpack - rails 5.1 Webpack-dev 服务器启动错误

转载 作者:行者123 更新时间:2023-12-04 12:16:36 26 4
gpt4 key购买 nike

ruby version - 2.4.2

rails - 5.1

rails new my_app --webpack=react

当我尝试使用 foreman start -f Procfile.dev 启动服务器时或只是 ./bin/webpack-dev-server
我收到以下错误,但找不到原因。任何帮助表示赞赏。
    /Users/shani/Wspace/myapp/node_modules/webpack-dev-server/bin/webpack-dev-server.js:405
throw e;
^

TypeError: Cannot read property 'compile' of undefined
at addCompilerHooks (/Users/shani/Wspace/myapp/node_modules/webpack-dev-server/lib/Server.js:71:16)
at new Server (/Users/shani/Wspace/myapp/node_modules/webpack-dev-server/lib/Server.js:81:5)
at startDevServer (/Users/shani/Wspace/myapp/node_modules/webpack-dev-server/bin/webpack-dev-server.js:398:14)
at processOptions (/Users/shani/Wspace/myapp/node_modules/webpack-dev-server/bin/webpack-dev-server.js:361:5)
at Object.<anonymous> (/Users/shani/Wspace/myapp/node_modules/webpack-dev-server/bin/webpack-dev-server.js:504:1)
at Module._compile (module.js:662:30)
at Object.Module._extensions..js (module.js:673:10)
at Module.load (module.js:575:32)
at tryModuleLoad (module.js:515:12)
at Function.Module._load (module.js:507:3)

最佳答案

我在 webpack-dev-server v3.1.0 中遇到了完全相同的异常。我降级到 v2.11.1,一切都很好。

https://github.com/rails/webpacker/issues/1303#issuecomment-369090507

关于webpack - rails 5.1 Webpack-dev 服务器启动错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49048003/

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