I'm updating a fairly old project to rails 6, and adapt to current "rails ways". And I've just installed webpacker, but I've run into problem I can't seem to find a way to solve.
When running the project, I get this error: Uncaught Error: Cannot find module '@rails/ujs'
I've tried to reinstall rails-ujs through yarn, but to no effect.
Also I've tried to comment the line require("@rails/ujs").start()
from my app/javascript/packs/application.js, and yet I got another error: Uncaught Error: Cannot find module '@rails/activestorage'
.
Which leads me to believe that its the global @rails that is not being recognized, however I have no idea where is it set or how to do so.
My questions are: Can I set @rails myself?
Is there a way to re-generate it?
or
Is there another configuration I should fix?