First of all: I'm writting this one to help people (I'm hoping google indexes it)
Recently, with AppCenter being deprecated we've started migrating to expo EAS, we also wanted to "use expo", and that means we'll need to setup expo modules, which I did following the tutorial
However, after successfuly compiling to iOS, I had issues in android, one
very annoying one was EarlyJSError: unexpected token "." stack
, it made me lose 3 days of my sanity due to various factors
Anyway, the problem is that, by following expo tutorial, I've ran their cli and it changed our getJSMainModuleName
to:
override fun getJSMainModuleName(): String = ".expo/virtual-entry"
Which doesn't work in android when you combine newArchEnabled=true
+ hermesEnabled=false
(iirc it worked with hermes true). I can only guess
that the .
token is the .expo/...
part, but there's absolutely no possible detail about that trace and when
I tried changing the .
for another char the error changed to a "cannot find entry", so I dismissed that.
After recreating a project from scratch, adding expo and ruling out dependencies and code, I've found out that actually, you should be sticking with the normal entry:
override fun getJSMainModuleName(): String = "index"
Note: another thing that made me lose too much time was that, when I
thought "its something bout main module name", I tested it with "index.js"
, which didn't work and made
me dismiss this possibility
I hope this explanation or ref about the EarlyJSError: unexpected token "." stack issue helps someone.
I had another one,
EarlyJSError: unexpected token "?" stack
, which was caused by me inputing the wrongjsEngine
entry in app.json