question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Webpacker can't find application in ... manifest.json (at runtime)

See original GitHub issue

Steps to reproduce

Follow the Get started with Webpacker instruction exactly, except with an existing app.

Expected behavior

Render my component.

Actual behavior

Upon hitting the route that serves the view with the react component, get this:

Webpacker can't find application in <my app path>/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:
{
}

The message is correct, there is no public/packs/manifest.json file. That was not in the instructions, so I assume it is supposed to be created, I guess by the webpack dev server.

I updated yarn to the latest version: 1.16.0.

System configuration

Webpacker version: 4.0.7 React-Rails version: 2.5.0 Rails version: 5.2.3 Ruby version: 2.6.3

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

28reactions
BookOfGregcommented, Jun 26, 2019

Node modules get corrupt all the time. Javascript does this often, I tend to see this myself randomly once a month. Especially prevalent on Windows, still happens but less often on Ubuntu. I tend to trash all current assets and modules and do a clean rebuild.

rm -rf node_modules
rails assets:clobber
yarn
rails assets:precompile

If that doesn’t so it, check you can install them gem onto a rails new foo --webpack application to confirm it’s not something with your machine. If that works and it’s still not working then it’s some config in your existing app.

5reactions
Sumeet-Rainacommented, Sep 28, 2020

Ran into this issue today while setting up a new Rails app.

Webpacker can't find application in <my app path>/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:
{
}

while running $ bundle exec rails webpacker:install

I spotted following error in the console

error portfolio@0.1.0: The engine "node" is incompatible with this module. Expected version ">= 10.13.0". Got "10.0.0"
error Found incompatible module.

After a lot of trial and error I learnt that you can just resolve this issue in 3 steps:

$ node -v
$ nvm install 10.13.0
$ bundle exec rails webpacker:install
Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpacker can't find application - ruby on rails - Stack Overflow
Try simply running the yarn command in your project directory. That should result in a manifest.json file being created - among other things....
Read more >
Webpacker can't find application.js in manifest.json
Webpacker can't find application.js in /Users/can/RubymineProjects/cancoel/public/packs/manifest.json. Possible causes: 1.
Read more >
Webpacker can't find application.js in /app/public/packs ...
I had this error yesterday and solved it by editing the webpacker.yml file to point to the packs/application.js file. I edited the source_path...
Read more >
Webpacker Can't Find Application.Js In Manifest.Json - ADocLib
Webpacker can pretend everything went smooth with the Debugging silently failing compilation aka Webpacker can't find application.js in public/packs/manifest.
Read more >
application does not start after run bin/setup (page xviii)
... (Webpacker can't find application.css in /Users/thomas/Documents/Websites/rails-frontend/public/packs/manifest.json. Possible causes:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found