Currently we use Rails 6 for our application. It\'s working fine in production but in development mode it throws some errors. Please assist me.
This is how my applic
Check the directory names to make sure they aren't conflicting with Webpacker's output. In my case, Rails was unable to find application.css even though Webpacker had successfully compiled it.
// Webpacker log output
Asset Size Chunks Chunk Names
application.js 3.62 MiB application [emitted] application
css/application-631a168a.css 332 KiB application [emitted] [immutable] application
My relevant directory structure:
app/javascript
|——packs
| └——application.js
└——src
└——assets
|——css
└——scss
└——application.scss
In my case, the problem was that I already had a directory named css, so when Rails went to look for the compiled css/application.css, it went to this directory instead of the one generated by Webpacker and wasn't able to find application.css.
Deleting the conflicting directory fixed it:
$ rm -rf app/javascript/src/css // change path appropriately