Webpack assets are broken. No, just kidding, they just dont work how you expect them to. I probably need to file a bug report for this one..
Assets were not building, but the compiling would say otherwise. I thought my assets were good as gold.
From the gitlab-ci output:
Compiled all packs in /app/public/packs
Unfortunately, the assets were done for. When we deployed to production, the css was broken and the JS didn’t even load.
It was even better the fact that the app wa running at a subdirectory which was all new to me. There were many problems with the scenario, but the good news was that “it was working on my local machine.”
app/bin/webpack vs rails webpack:compile
I would have never guessed there’s a difference between
bundle exec rails webpacker:compile, but let me tell you there is and it’s a big one.
Assets compile incorrectly with the rails reccommended way