Webpacker::Manifest::MissingEntryError in .... localhost:3000/* 错误 [英] Webpacker::Manifest::MissingEntryError in .... localhost:3000/* errors

查看:91
本文介绍了Webpacker::Manifest::MissingEntryError in .... localhost:3000/* 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Ruby:ruby 2.6.5p114 (2019-10-01 修订版 67812) [x86_64-linux]
Rails:Rails 6.0.2
操作系统:Windows 到 VM(vagrant ssh -> 到 ubuntu 机器:Linux vagrant-ubuntu-trusty-64 3.13.0-170-generic #220-Ubuntu SMP x86_64 GNU/Linux

Ruby: ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux]
Rails: Rails 6.0.2
OS: Windows to a VM (vagrant ssh -> to ubuntu machine : Linux vagrant-ubuntu-trusty-64 3.13.0-170-generic #220-Ubuntu SMP x86_64 GNU/Linux

当我运行 rails server -b 0.0.0.0 时,我可以访问 localhost:3000 并看到 耶!你在 Rails 上!

when I run rails server -b 0.0.0.0 I can access localhost:3000 and see the Yay! You’re on Rails!

但是当我尝试导航到 localhost:3000/say/hello浏览器出现以下错误

but when I attempt to navigate to localhost:3000/say/hello the below error comes up in browser

Showing /files_on_your_computer/rails6tut/demo/app/views/layouts/application.html.erb where line #9 raised:

Webpacker can't find application in /files_on_your_computer/rails6tut/demo/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
9
10
11
12
              

    <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
    <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
  </head>

  <body>

Rails.root: /files_on_your_computer/rails6tut/demo

控制台错误:

vagrant@vagrant-ubuntu-trusty-64:/files_on_your_computer/rails6tut/demo$ rails server -b 0.0.0.0                                    => Booting Puma
=> Rails 6.0.2 application starting in development
=> Run `rails server --help` for more startup options
Puma starting in single mode...
* Version 4.3.1 (ruby 2.6.5-p114), codename: Mysterious Traveller
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop
Started GET "/say/hello" for 10.0.2.2 at 2019-12-17 17:51:09 +0000
   (1.5ms)  SELECT sqlite_version(*)
Processing by SayController#hello as HTML
  Rendering say/hello.html.erb within layouts/application
  Rendered say/hello.html.erb within layouts/application (Duration: 4.3ms | Allocations: 271)
Completed 500 Internal Server Error in 115ms (ActiveRecord: 0.0ms | Allocations: 7431)



ActionView::Template::Error (Webpacker can't find application in /files_on_your_computer/rails6tut/demo/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:
{
}
):
     6:     <%= csp_meta_tag %>
     7:
     8:     <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
     9:     <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
    10:   </head>
    11:
    12:   <body>

app/views/layouts/application.html.erb:9
Started GET "/" for 10.0.2.2 at 2019-12-17 17:54:56 +0000
Processing by Rails::WelcomeController#index as HTML
  Rendering /home/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/railties-6.0.2/lib/rails/templates/rails/welcome/index.html.erb
  Rendered /home/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/railties-6.0.2/lib/rails/templates/rails/welcome/index.html.erb (Duration: 3.1ms | Allocations: 190)
Completed 200 OK in 6ms (Views: 5.4ms | ActiveRecord: 0.0ms | Allocations: 899)

我在 heroku 上看到了一些类似的问题,但我在本地运行它,所以我有点困惑.我正在关注带有 Rails 6 的敏捷 Web 开发一书.

I have seen some similar issues on heroku, but i am running this locally so I am a bit confuddled. I am following the Agile Web Development with rails 6 book.

推荐答案

我遇到了同样的问题,我使用的是最新版本的 node v15.2.0 并切换到较低版本的 node v14.8.0 和 webpacker 工作正常.

I faced the same issue, I was using the latest version of node v15.2.0 and switched to a lower version of node v14.8.0 and webpacker is working fine.

参考:[https://github.com/rails/webpacker/issues/2779#issuecomment-727170370]

Reference: [https://github.com/rails/webpacker/issues/2779#issuecomment-727170370]

这篇关于Webpacker::Manifest::MissingEntryError in .... localhost:3000/* 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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