Expo attached vs detached: different js runtime?


#1

Hi,

It seems after detaching, when running on my android device, the “console.time” function is not defined anymore while it worked fine inside Expo client on same device.

Can someone explain me the differences between the attached and detached JS runtimes?

Thanks


Which JS APIs are supported in Expo runtimes?
#2

You could have some dev flags that are changing those functions to null.
When you run in production perhaps there is some use-strict that is surfacing the error.
A good way to test without deploying is to run with: exp start --no-dev --strict :smiley:

I think that console.time isn’t supported - I stub this out a lot in expo-three.
My solution to this is to use this library: react-native-console-time-polyfill


#3

Thanks @bacon Ill try that :wink:


#4

@bacon there’s no --strict option in help of exp cli v47 is it some hidden feature? how does this flag work?


#5

The --strict option has been removed in exp v47, since this feature is not currently implemented in the bundler and therefore didn’t work as intended.