gpt4 book ai didi

ruby-on-rails - Webpacker:resolved_pa​​ths 选项已被弃用。改用 additional_paths

转载 作者:行者123 更新时间:2023-12-04 11:30:24 28 4
gpt4 key购买 nike

我将 webpacker 从 4.x 升级到 5.2.1 并开始收到此警告:

The resolved_paths option has been deprecated. Use additional_paths instead.
这看起来很简单,我的 config/webpacker.yml几乎没有修改:
  # Additional paths webpack should lookup modules
# ['app/assets', 'engine/foo/app/assets']
resolved_paths: [
'app/assets',
]
但是做一个简单的 s/resolved_paths/additional_paths/没有工作:
[Webpacker] Compiling...
[Webpacker] Compilation failed:
Hash: 7448f36a43523a84e146
Version: webpack 4.44.1
Time: 5803ms
Built at: 10/15/2020 11:57:06 AM
Asset Size Chunks Chunk Names
js/application-a019b363e4513fe092e6.js 3.02 MiB application [emitted] [immutable] application
js/application-a019b363e4513fe092e6.js.map 3.03 MiB application [emitted] [dev] application
js/hello_react-40e806bdb6de496532d8.js 1.05 MiB hello_react [emitted] [immutable] hello_react
js/hello_react-40e806bdb6de496532d8.js.map 1.21 MiB hello_react [emitted] [dev] hello_react
js/server_rendering-9cd9dcc6e1cebb2a8063.js 2.25 MiB server_rendering [emitted] [immutable] server_rendering
js/server_rendering-9cd9dcc6e1cebb2a8063.js.map 2.44 MiB server_rendering [emitted] [dev] server_rendering
manifest.json 1.05 KiB [emitted]
Entrypoint application = js/application-a019b363e4513fe092e6.js js/application-a019b363e4513fe092e6.js.map
Entrypoint hello_react = js/hello_react-40e806bdb6de496532d8.js js/hello_react-40e806bdb6de496532d8.js.map
Entrypoint server_rendering = js/server_rendering-9cd9dcc6e1cebb2a8063.js js/server_rendering-9cd9dcc6e1cebb2a8063.js.map
[./app/javascript/channels sync recursive _channel\.js$] ./app/javascript/channels sync _channel\.js$ 160 bytes {application} [built]
[./app/javascript/channels/index.js] 211 bytes {application} [built]
[./app/javascript/components sync recursive ^\.\/.*$] ./app/javascript/components sync ^\.\/.*$ 2.42 KiB {application} {server_rendering} [built]
[./app/javascript/packs/application.js] 10.3 KiB {application} [built]
[./app/javascript/packs/hello_react.jsx] 1.05 KiB {hello_react} [built]
[./app/javascript/packs/server_rendering.js] 301 bytes {server_rendering} [built]
[./node_modules/webpack/buildin/amd-options.js] (webpack)/buildin/amd-options.js 80 bytes {application} {server_rendering} [built]
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 905 bytes {application} {server_rendering} [built]
[./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 552 bytes {application} {server_rendering} [built]
+ 474 hidden modules

ERROR in ./app/javascript/components/menu/MenuComponent.jsx
Module not found: Error: Can't resolve 'images/ellipsis-v.svg' in '/home/me/app/javascript/components/menu'
很明显 additional_paths不仅仅是替代品,即使文档建议它应该是。
在我跳入源代码试图了解这里发生的事情之前,有人能快速解决吗?

最佳答案

该错误记录在 Web 浏览器的控制台中,它来自 npm 包。您需要同时升级:webpacker gem 和@rails/webpacker npm 包。

关于ruby-on-rails - Webpacker:resolved_pa​​ths 选项已被弃用。改用 additional_paths,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64363427/

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