webpacker: Webpacker::Manifest::MissingEntryError

I’ve started a rails project using the rails new and --webpack=react. I generated a new controller updated my postgresql password in the database.yml. Up to this point everything works fine. At this point all I’m trying to do is get react to render the default hello_react.jsx file the was generated as an example by rails. When I put the <%= javascript_pack_tag 'hello_react' %> in my view and run the server I get the following error.

Webpacker::Manifest::MissingEntryError in Home#index Showing G:/…/…/…/myGroceryList/app/views/home/index.html.erb where line #1 raised:

Webpacker can’t find hello_react.js in G:/…/…/…/myGroceryList/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: { }

I have pushed the project up to github. Any thought on what is going wrong?

UPDATE: I’ve posted the same question on Stackoverflow. There is a bit more discussion there that might help.

RESOLUTION: As best I can tell this error fires when your public/packs folder is missing the Manifest file or is missing all together. What was happening in my case was Webpackers compilation step was silently failing and not creating the public/packs folder.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 3
  • Comments: 27 (17 by maintainers)

Most upvoted comments

Nothing work for me on Rails 6.0.3.2 except yarn add @rails/webpacker and then rails server

Followed @mehmoodak’s solution on Rails 6.0.3.2 yarn add @rails/webpacker and then ran rails server

It works! Thanks

It was node. I forgot to run npm install.

@KhalidH82, without seeing your project it could be hard to figure this out but I will give it a shot. Since your packs file is there I take it that webpack compiled without error. If you haven’t already, I think you should be able to delete your packs folder completely and then let webpacker recompile. It should regenerate your packs folder again. Another thought, Is the extension on your react hello_world file .jsx? Finally, do you have the javascript_pack_tag in your home view?

I got the same error just now.

In my case, it seemed to be that another project already had webpack-dev-server running, so the port was already taken. But the exception didn’t make that clear. I found out by trying to run webpack-dev-server manually and getting a “port in use” error. More details in https://stackoverflow.com/a/59069041/6962.

I’ll open an issue to suggest some improvements in this situation. UPDATE: https://github.com/rails/webpacker/issues/2378

Perhaps, we can backport this too to 3.x.