質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Vue.js

Vue.jsは、Webアプリケーションのインターフェースを構築するためのオープンソースJavaScriptフレームワークです。

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

JavaScript

JavaScriptは、プログラミング言語のひとつです。ネットスケープコミュニケーションズで開発されました。 開発当初はLiveScriptと呼ばれていましたが、業務提携していたサン・マイクロシステムズが開発したJavaが脚光を浴びていたことから、JavaScriptと改名されました。 動きのあるWebページを作ることを目的に開発されたもので、主要なWebブラウザのほとんどに搭載されています。

Q&A

解決済

1回答

1561閲覧

Webpacker::Manifest::MissingEntryErrorエラー

amby

総合スコア40

Vue.js

Vue.jsは、Webアプリケーションのインターフェースを構築するためのオープンソースJavaScriptフレームワークです。

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

JavaScript

JavaScriptは、プログラミング言語のひとつです。ネットスケープコミュニケーションズで開発されました。 開発当初はLiveScriptと呼ばれていましたが、業務提携していたサン・マイクロシステムズが開発したJavaが脚光を浴びていたことから、JavaScriptと改名されました。 動きのあるWebページを作ることを目的に開発されたもので、主要なWebブラウザのほとんどに搭載されています。

0グッド

0クリップ

投稿2021/04/04 02:11

現象

rails sでhttp://localhost:3000/にアクセスするとWebpacker::Manifest::MissingEntryErrorのエラーが表示されます。
ネットで調べてみるといろいろ解決方法が乗っているのですが、どれを試しても解決しません。
もし解決しそうな可能性のある方法をご存知でしたら教えていただきたいです。

エラー内容

Webpacker::Manifest::MissingEntryError at /
Webpacker can't find controllers/home.js in /Users/taishiito/rails-minimum-skill-check/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:
{
}

イメージ説明

rails sしている最中のターミナルのログ

Started GET "/" for ::1 at 2021-04-04 11:06:52 +0900 (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Processing by HomeController#index as HTML Parameters: {"locale"=>"en"} Rendering home/index.html.haml within layouts/application [Webpacker] Compiling... [Webpacker] Compilation failed: yarn run v1.22.10 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. warning package.json: No license field warning package.json: No license field error Command "webpack" not found. Rendered home/index.html.haml within layouts/application (1165.5ms) Completed 500 Internal Server Error in 1178ms (ActiveRecord: 0.0ms) Webpacker::Manifest::MissingEntryError - Webpacker can't find controllers/home.js in /Users/taishiito/rails-minimum-skill-check/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: { }: app/views/home/index.html.haml:2:in `_app_views_home_index_html_haml___265118699086114215_60680' Started POST "/__better_errors/b3bfe9404eca366c/variables" for ::1 at 2021-04-04 11:06:53 +0900 Since there is no EDITOR or BETTER_ERRORS_EDITOR environment variable, using Textmate by default.

app/views/home/index.html.haml

-# Needs js suffix if exists same dirs = javascript_pack_tag 'controllers/home.js' %div{style: "min-height:600px;"} %h4 Toppage #home-app %el-row %el-col{":md": "12"} %el-progress{":percentage": "50"} %el-col{":md": "12"} %el-tag{"type": "success"} Tag 2 %el-select{"v-model": "selectedValue"} %el-option{"v-for": "item in [{value: 'v-a', label: 'v-l'}]", ":key": "item.value", ":label": "item.label", ":value": "item.value"} {{message2}} {{selectedValue}} %sample %router-link{"to": "/page1"} Page1 \| %router-link{"to": "/page2"} Page2 %router-view{"v-bind:message2": "message2"}

home_controller

class HomeController < ApplicationController def index if user_signed_in? redirect_to dashboard_path else if Rails.env == 'production' redirect_to new_user_session_path end end end end

Gemfile

source 'https://rubygems.org' git_source(:github) do |repo_name| repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") "https://github.com/#{repo_name}.git" end ruby '2.7.2' gem 'rails', '~> 5.2.4' gem 'pg', '~> 0.18' gem 'puma', '~> 3.12' gem 'sass-rails', '~> 5.0' gem 'uglifier', '>= 1.3.0' gem 'coffee-rails', '~> 4.2' gem 'jquery-rails' gem 'jbuilder', '~> 2.5' gem 'hamlit' gem "devise" gem 'bootstrap-sass' gem 'rest-client' gem 'webpacker' group :production do gem 'rails_12factor' gem 'dalli' gem 'newrelic_rpm' end group :development, :test do gem 'pry-rails' gem 'pry-byebug' gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] end group :development do gem 'web-console', '>= 3.3.0' gem 'listen', '>= 3.0.5', '< 3.2' gem 'spring' gem 'spring-watcher-listen', '~> 2.0.0' gem 'better_errors' gem 'rails_layout' end group :test do gem 'capybara' gem 'database_cleaner' gem 'launchy' gem 'factory_bot_rails' gem 'rspec-rails' end gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

試してみたこと(これらは全て試しましたが、エラー内容は多少変われど解決しませんでした)

・Railsのバージョンを6に上げてみる
・yarnのバージョン変更(参考
・nodeのバージョン変更(参考
・「bundle exec rails webpacker:install」の実行(参考

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

yarn installしたら解決しました。

投稿2021/04/12 08:29

amby

総合スコア40

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問