24
gitpush
6y

Wasted 7 hours for this:
import moment from 'moment'

Should be:
var moment = require('moment')

What happened? When app running in debug mode all is working without issues! When generating release APK, it crashes when using moment

Fucking hybrid shit apps...

Comments
  • 1
    lua vs python?
    Which one is it?
  • 1
    @Gregozor2121 neither, React Native lol
  • 2
    Most likely a JS versioning issue. The import syntax is an ECMA6 feature, which has spotty support.
  • 1
    @Nevoic what made me angry is all other imports from other dependencies are working, only "moment" is causing this crash, if I use require() it works, if I use import it crash
  • 1
    @gitpush there's some technical difference between them that alludes me. I had a similarish issue today, where some function wasn't recognized if I used a certain import tactic, but if I used the other one it was.

    So it probably also has something to do with how they're exporting it.

    This environment really makes me miss Kotlin & Maven. None of this weird shit happens there lol
  • 0
    @Nevoic true I am ok writing the same app twice than having to suffer from this type of issues because after all those are just some useless things to be good enough to waste time on
  • 1
    Maybe Moment is a helper, rather than a class/library? /wingingit
  • 1
    @xewl but it works when in debug mode but when in production it crashes
  • 1
    @gitpush that's just sad :( Hope the actual reason becomes clear soon
  • 0
    @xewl I hope so, for now the only fix was to use require('') instead of import
  • 1
    Fuck React Native, kill it with fire.

    cc @ineptcoder
  • 0
    @Rollo but it's working fine on iOS just Android crashing :/
  • 0
    @fighter hats off for you 😀
Add Comment