WebPacker找不到应用程序 [英] Webpacker can't find application

查看:6
本文介绍了WebPacker找不到应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在根据"Rails快速入门"创建一个新的Rails应用程序。应用程序在步骤4.1中正常启动。但是当我创建我的第一个控制器时,我有一个webpack错误。

我是新来的webpack,我有所有的文档,但我不知道哪里错了或遗漏了...

  • Windows 10 1903
  • Ruby 2.6
  • Rails 6.0.0
  • NodeJS 12.11.0

rails webpacker:install
   identical  config/webpacker.yml
Copying webpack core config
       exist  config/webpack
   identical  config/webpack/development.js
   identical  config/webpack/environment.js
   identical  config/webpack/production.js
   identical  config/webpack/test.js
Copying postcss.config.js to app root directory
   identical  postcss.config.js
Copying babel.config.js to app root directory
   identical  babel.config.js
Copying .browserslistrc to app root directory
   identical  .browserslistrc
The JavaScript app source directory already exists
       apply  C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/webpacker-4.0.7/lib/install/binstubs.rb
  Copying binstubs
       exist    bin
   identical    bin/webpack
   identical    bin/webpack-dev-server
      append  .gitignore
Installing all JavaScript dependencies [4.0.7]
         run  yarn add @rails/webpacker from "."
yarn add v1.17.3
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.9: The platform "win32" is incompatible with this module.
info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > webpack-dev-server@3.8.2" has unmet peer dependency "webpack@^4.0.0".
warning "webpack-dev-server > webpack-dev-middleware@3.7.2" has unmet peer dependency "webpack@^4.0.0".
[4/4] Building fresh packages...
success Saved 1 new dependency.
info Direct dependencies
└─ @rails/webpacker@4.0.7
info All dependencies
└─ @rails/webpacker@4.0.7
Done in 4.48s.
Installing dev server for live reloading
         run  yarn add --dev webpack-dev-server from "."
yarn add v1.17.3
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.9: The platform "win32" is incompatible with this module.
info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "webpack-dev-server > webpack-dev-middleware@3.7.2" has unmet peer dependency "webpack@^4.0.0".
warning " > webpack-dev-server@3.8.2" has unmet peer dependency "webpack@^4.0.0".
[4/4] Building fresh packages...
success Saved 1 new dependency.
info Direct dependencies
└─ webpack-dev-server@3.8.2
info All dependencies
└─ webpack-dev-server@3.8.2
Done in 4.92s.
Webpacker successfully installed �🎉🍰🍰

Webpacker::Manifest::MissingEntryError in Welcome#index

Showing C:/Users/[...]/site_test/app/views/layouts/application.html.erb where line #9 raised:

Webpacker can't find application in C:/Users/[...]/site_test/public/packs/manifest.json. Possible causes:
1. You want to set webpacker.yml value of compile to true for your environment
   unless you are using the `webpack -w` or the webpack-dev-server.
2. webpack has not yet re-run to reflect updates.
3. You have misconfigured Webpacker's config/webpacker.yml file.
4. Your webpack configuration is not creating a manifest.
Your manifest contains:
{
}

Extracted source (around line #9):

7
8      <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
9      <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
10 </head>
11 <body>
12

推荐答案

感谢您的帮助。不幸的是,什么都不起作用。

rails assets:clobber删除NODE_MODULES文件夹后立即返回";错误:找不到完整性文件&/strong>。(纱线安装后工作--检查文件)。

ANDrails assets:precompile返回

"C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/webpacker-4.0.7/lib/webpacker/webpack_runner.rb:23:in `exec': No such file or directory - C:Users[...]site_test
ode_modules.bin/webpack (Errno::ENOENT)"

但我发现了问题所在:我电脑中的位置! 可能是名称问题...

这篇关于WebPacker找不到应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆