Open yungkittty opened 4 years ago
I had the same issue. Creating an empty index.js
in the main directory skips the error, the renderer then loads the custom entry point successfully.
Not sure if that's something that should be fixed by the expo-electron
setup or in electron-webpack
. Maybe just add it to the guide for now?
I had the same issue.
Had the same issue as well building on Linux, adding empty index.js worked, thanks!
FWIW, the Windows and Mac versions built fine with the same package.json referencing AppEntry.js
Where do i add the index.js file
I encountered the same problem and I dug a bit to understand why it works on Windows / Mac but not Linux. So basically,
the electron-webpack main is trying to find index
, main
and app
with any one of suffixes among ts
, js
, tsx
and jsx
. For Expo app, you got App.tsx
in the renderer source folder ./
defined here
Under Windows or MacOS, as if the filesystem is using case insensitive filename filesystem, the computeEntryFile
is gonna find App.tsx
regardless it's not app.tsx
. But for Linux, usually case sensitive filename filesystem is used, as a result, it cannot find the entry point for index file.
A simple solution by adding an empty index.js in renderer source folder could work, and it should be filtered out by this adapter here:
Can't yarn expo-electron
be altered to create a empty index.js file if it doesn't yet exist?
It really doesn't have to be that hard to implement a solution to this just to have support for linux out of the box.... It's embarrassingly easy to add to this project no?
@Simbaclaws doesn't work for me, loads of issues when adding it to a blank expo project.
Description
I'm trying to setup expo with electron (SDK 36).
To do so, I've followed this guide.
Finally, I've tried to run
yarn expo-electron start
.Expected Behavior
It should start the electron app using the
AppEntry.js
(main field from package.json) or whatever pre-configured (index||app).(js||ts) from expo. This would ensure all the configuration of expo for web apps is also applied to electron and it would keep a universal entry point (if none special configuration).Observed Behavior
I've looked-up the configuration of electron-webpack and it's this function that throw this error. From all the docs and examples provided by expo none talks about declarating a (index||app).(js||ts) file.
Environment
Reproducible Demo
I've this error with this repository (expo/examples) which use the sdk 35.