The problem was that one of the two files that exist in the root javascript (app/javascript) folder was importing another through relative importing.
app/javascript
Solve it by importing it the correct way (not using relative import).