Webpacker can't find application

This error seems to be the key.

Your manifest contains:
{
}

Try simply running the yarn command in your project directory. That should result in a manifest.json file being created - among other things.

If that doesn't work, I found this issue on github from which I am verbatim reciting the following commands that may help you. This will reset all built assets and node_modules.

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

Check out that link for more information.


run the command

rails webpacker:install

This solved the problem for me.


Like Salman's answer above, the command

$ rails webpacker:install

or

$ bundle exec rails webpacker:install

solves the issue. Which is quite strange for me, as rails does not install webpacker automatically but includes the javascript_pack_tag in the default layout anyway. HOWEVER, if yarn complains about your node version, make sure to install the correct one and switch to it, then run the above command again. This simple thing took me an hour to figure out. For instance:

$ nvm install 13.7
$ nvm use 13.7
$ rails webpacker:install