I can't solved Webpacker::Manifest::MissingEntryError

First of all, good forum to all. I’m trying to develop a simple application with Rails, but I’m getting Webpacker::Manifest::MissingEntryError. Does anyone know how to solve this problem?

Console Error:

=> Booting Puma
=> Rails 6.1.4.4 application starting in development 
=> Run `bin/rails server --help` for more startup options
Puma starting in single mode...
* Puma version: 5.5.2 (ruby 3.0.1-p64) ("Zawgyi")
*  Min threads: 5
*  Max threads: 5
*  Environment: development
*          PID: 62615
* Listening on http://127.0.0.1:3000
* Listening on http://[::1]:3000
Use Ctrl-C to stop
Started GET "/articles" for 127.0.0.1 at 2021-12-25 15:39:53 +0300
   (3.1ms)  SELECT sqlite_version(*)
Processing by ArticlesController#index as HTML
  Rendering layout layouts/application.html.erb
  Rendering articles/index.html.erb within layouts/application
  Rendered articles/index.html.erb within layouts/application (Duration: 2.3ms | Allocations: 357)
[Webpacker] Compiling...
[Webpacker] Compilation failed:
/home/tuncay/projeler/Rails/BootstrapApp/node_modules/webpack-cli/bin/cli.js:93
				throw err;
				^

Error: Cannot find module '@rails/webpacker'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (/home/tuncay/projeler/Rails/BootstrapApp/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
    at Object.<anonymous> (/home/tuncay/projeler/Rails/BootstrapApp/config/webpack/environment.js:1:87)
    at Module._compile (/home/tuncay/projeler/Rails/BootstrapApp/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (/home/tuncay/projeler/Rails/BootstrapApp/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
    at Object.<anonymous> (/home/tuncay/projeler/Rails/BootstrapApp/config/webpack/development.js:3:21)
    at Module._compile (/home/tuncay/projeler/Rails/BootstrapApp/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (/home/tuncay/projeler/Rails/BootstrapApp/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
    at WEBPACK_OPTIONS (/home/tuncay/projeler/Rails/BootstrapApp/node_modules/webpack-cli/bin/utils/convert-argv.js:114:13)
    at requireConfig (/home/tuncay/projeler/Rails/BootstrapApp/node_modules/webpack-cli/bin/utils/convert-argv.js:116:6)
    at /home/tuncay/projeler/Rails/BootstrapApp/node_modules/webpack-cli/bin/utils/convert-argv.js:123:17
    at Array.forEach (<anonymous>)
    at module.exports (/home/tuncay/projeler/Rails/BootstrapApp/node_modules/webpack-cli/bin/utils/convert-argv.js:121:15)
    at yargs.parse (/home/tuncay/projeler/Rails/BootstrapApp/node_modules/webpack-cli/bin/cli.js:71:45)
    at Object.parse (/home/tuncay/projeler/Rails/BootstrapApp/node_modules/yargs/yargs.js:576:18)
    at /home/tuncay/projeler/Rails/BootstrapApp/node_modules/webpack-cli/bin/cli.js:49:8
    at Object.<anonymous> (/home/tuncay/projeler/Rails/BootstrapApp/node_modules/webpack-cli/bin/cli.js:366:3)
    at Module._compile (internal/modules/cjs/loader.js:778:30)

  Rendered layout layouts/application.html.erb (Duration: 7117.8ms | Allocations: 8256)
Completed 500 Internal Server Error in 7153ms (ActiveRecord: 0.0ms | Allocations: 14438)


  
ActionView::Template::Error (Webpacker can't find application.js in /home/tuncay/projeler/Rails/BootstrapApp/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:
{
}
):
     7:     <%= csp_meta_tag %>
     8: 
     9:     <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
    10:     <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
    11:   </head>
    12: 
    13:   <body>
  
app/views/layouts/application.html.erb:10

ScreenShot:

Gemfile:

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '3.0.1'

gem 'rails', '~> 6.1.4', '>= 6.1.4.4'
gem 'sqlite3', '~> 1.4'
gem 'puma', '~> 5.0'
gem 'sass-rails', '>= 6'
gem 'webpacker', '~> 5.0'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.7'
# gem 'redis', '~> 4.0'
# gem 'bcrypt', '~> 3.1.7'

# gem 'image_processing', '~> 1.2'

gem 'bootsnap', '>= 1.4.4', require: false

group :development, :test do
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end

group :development do
  gem 'web-console', '>= 4.1.0'
  gem 'rack-mini-profiler', '~> 2.0'
  gem 'listen', '~> 3.3'
  gem 'spring'
end

group :test do
  gem 'capybara', '>= 3.26'
  gem 'selenium-webdriver'
  gem 'webdrivers'
end

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

package.json:

{
  "name": "bootstrap-app",
  "private": true,
  "dependencies": {
    "@rails/actioncable": "^6.0.0",
    "@rails/activestorage": "^6.0.0",
    "@rails/ujs": "^6.0.0",
    "turbolinks": "^5.2.0",
    "webpack": "^4.46.0",
    "webpack-cli": "^3.3.12"
  },
  "version": "0.1.0",
  "devDependencies": {
    "webpack-dev-server": "^3"
  }
}

Thanks in advance.

try re-installing webpacker with rails webpacker:install

1 Like