@elia String.force_encoding fails for ES5/6, as it tries to assing to a property of a primitive. For ES6 modules, all modules are treated as "use strict"; so they are in ES5 and no longer ES3, where this previously worked.
It could work, if Opal would use the String class, like
new String('bla') in js, then the strings would be objects an the properties could be assigned.
How to handle? Why is the force_encoding there in the first place?