expo-electron-adapter icon indicating copy to clipboard operation
expo-electron-adapter copied to clipboard

Runtime error after using electron adapter

Open kawasaki656 opened this issue 4 years ago • 5 comments

Steps to reproduce: yarn install yarn electron-webpack yarn electron-builder --dir -c.compression=store -c.mac.identity=null

Project: https://github.com/okasato/test-electron-expo-react-native After running executable file I get the folowing error: SyntaxError: Unexpected string image

kawasaki656 avatar Mar 30 '20 19:03 kawasaki656

Is this after following all the documentation here? @kawasaki656 please provide all the information we ask for in the bug report template

cruzach avatar Mar 31 '20 14:03 cruzach

@cruzach Yes, I setuped a project like written in the docs:

  • electron adapter was installed with yarn add -D @expo/electron-adapter
  • electron was bootstraped with yarn expo-electron
  • electron-builder was installed with yarn add -D electron-builder

After that I have webpack config electron-webpack.js and I tried to package an app with yarn electron-webpack. I get a target in dist folder image I checked the web app but it has 2 errors. Maybe it's correct because I don't know exactrly which target webpack uses. image After that I tried to package it to executable file with yarn electron-builder --dir -c.compression=store -c.mac.identity=null I got an app but got an error which I mentioned in issue when I run it. Where I was wrong ? Pls let me know.

kawasaki656 avatar Mar 31 '20 18:03 kawasaki656

And do I need to change main attribute in package.json ? I keep it as in repository node_modules/expo/AppEntry.js Maybe it needs to replace with dist/main/main.js or dist/renderer/renderer.js ?

kawasaki656 avatar Mar 31 '20 18:03 kawasaki656

I hate to add a +1 to this thread, but I’ve recently stumbled across this issue while setting up my CI/CD pipeline.

My repro looks largely the same as OP; the project runs fine under a debugger, but the built artifacts give a runtime error. This is with a fresh expo project.

pbgodwin avatar Apr 29 '20 21:04 pbgodwin

Same here... maybe related to https://github.com/expo/expo-cli/issues/1397

JulianSolros avatar Mar 10 '21 02:03 JulianSolros