Hello! I’m new to using Expo for desktop (using Electron).
The problem that I have is that it doesn’t seem to support es6 imports. I’m compiling the app with the following command:
yarn electron-webpack && yarn electron-builder --dir -c.compression=store -c.mac.identity=null
But when I launch the compiled app here’s what I get:
I have set up Expo for desktop using the instructions here: https://github.com/expo/expo/blob/master/docs/pages/versions/unversioned/guides/using-electron.md
My babel.config.js
includes babel-preset-expo
which I assume enables me to use the es6 import
keyword:
module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo', 'module:metro-react-native-babel-preset', 'module:react-native-dotenv'], // update this to make dot-env work
};
};
I tried using require()
in the node_modules/expo/AppEntry.js
file instead:
const registerRootComponent = require('expo').registerRootComponent;
const activateKeepAwake = require('expo-keep-awake').activateKeepAwake;
const App = require('../../App');
if (__DEV__) {
activateKeepAwake();
}
registerRootComponent(App);
But this just returned the same error on a different file.
I’ll continue trying to figure this out, but any guidance would be appreciated. Thank you!