2

i will just start my question a little bit structured:

background information

  • I am developing a React App with Electron on my Mac.
  • The customer uses this app on Windows 7 and 10.
  • The app is packaged with asar on a gitlab runner within a docker
  • the dockerfile for the runner is from electronuserland/builder:base

What works?

  • If I start the App locally I run the npm build script and start electron -> The app works fine!
  • If I package the App locally (on my Mac) for Windows and copy the .exe to my VM: -> The app works fine!

What does not work?

If my pipeline get triggered by my commit the gitlab runner starts to run the buildscript and the package script (The same ones I run locally for packaging and running my app) The build is "successfully" completed and the artifacts are stored on gitlab.

Then I download the .exe from the gitlab artifacts on my Windows VM and install the software. This absolutely works fine. The app can start up and some functions are pretty good working. But there is a problem with a package (or maybe some more, i do not know yet) It is the react-bootstrap-daterangepicker. It gives me an JS error with $this.$picker.daterangepicker is not a function I googled a lot and found existing problems with the package, but I do not understand why it is working when i package the app locally and not with the runner.

I removed my node-modules completey on my local machine and reinstalled them, and it is still working fine.

Do you have any idea? Where could be a difference between my local environment and the runner environment that can cause this kind of problem?

I am pretty stuck in this problem, and you would be my hero if you can help me to fix this!

Have a nice day!

Philipp Schemel
  • 943
  • 8
  • 19

1 Answers1

0

electron-builder recommends using electronuserland/builder:wine to build Windows targets. I'm not sure if this would fix the problem, but could you try using this image instead?

electronuserland/builder:wine — Wine, NodeJS 10 and required system dependencies. Based on builder:10. Use this image if you need to build Windows targets.

For more information: https://www.electron.build/multi-platform-build#provided-docker-images

Sagar Chakravarthy
  • 1,206
  • 1
  • 9
  • 4