damp-ram-97063
11/23/2023, 8:06 PMnpx expo prebuild I get an error saying that ES Module is not supported.
CommandError: require() of ES Module .../node_modules/@rudderstack/rudder-sdk-react-native/index.esm.js from /.../node_modules/@expo/config-plugins/build/utils/plugin-resolver.js not supported.
Instead change the require of index.esm.js in /Users/carlos/Documents/Code/Fair/equals-client-app/node_modules/@expo/config-plugins/build/utils/plugin-resolver.js to a dynamic import() which is available in all CommonJS modules.
I installed the Rudderstack SDK using npx expo install, and add it as a plugin on the app.config.ts
Apparently Expo doesn’t support ES modules? Is there any workaround?millions-activity-52391
11/23/2023, 8:06 PMcalm-yak-10773
11/24/2023, 6:44 AM{
"type": "module",
}
If the issue still persists, please provide the reproducible steps so that I can investigate it properly.
Also, you may create a new Expo project, try installing the RudderStack React Native SDK, and check if you encounter the error or not.damp-ram-97063
11/24/2023, 3:37 PMnpx expo run:android after npx expo prebuild --clean, I was simply doing npx expo start 🤦♂️
For anyone else that may find this message, It’s not necessary to add the Rudderstack SDK to the expo plugins. The only extra additional configuration needed is to add the iOS extra pod, since it’s not done automatically by the SDK.
This can be done using the “expo-build-properties” plugin on the app.config.ts like this:
expo: {
plugins: [
[
"expo-build-properties",
{
ios: {
extraPods: [{ name: "RSCrashReporter", modular_headers: true }],
},
},
],
],
}