zarathucorp / shiny-electron-template-m1

Template repository for build Standalone R Shiny application with Electron
MIT License
34 stars 38 forks source link

electron-forge start works, but electron-forge make does not work #5

Closed awosoga closed 1 year ago

awosoga commented 1 year ago

I have adapted the scripts to work for an Intel Mac and electron-forge start works fine, but when running electron-forge make I get the following error. Any help would be appreciated.

It looks like there's an incorrect symlink happening and I'm not sure why

An unhandled rejection has occurred inside Forge: Error: /var/folders/wb/yr_2rvy56d78b1kxpwzyfb4r0000gp/T/electron-packager/darwin-x64/test1-darwin-x64-qaLKr7/Electron.app/Contents/Resources/app/r-mac/fontconfig/fonts/conf.d/10-hinting-slight.conf: file "../../../../../../../../../../../../../Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/fontconfig/fontconfig/conf.avail/10-hinting-slight.conf" links out of the package at Filesystem.insertLink (/usr/local/lib/node_modules/@electron-forge/cli/node_modules/@electron/asar/lib/filesystem.js:104:13) at handleFile (/usr/local/lib/node_modules/@electron-forge/cli/node_modules/@electron/asar/lib/asar.js:132:20) at next (/usr/local/lib/node_modules/@electron-forge/cli/node_modules/@electron/asar/lib/asar.js:148:11) at next (/usr/local/lib/node_modules/@electron-forge/cli/node_modules/@electron/asar/lib/asar.js:149:12) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async MacApp.asarApp (/usr/local/lib/node_modules/@electron-forge/cli/node_modules/electron-packager/src/platform.js:224:5) at async MacApp.buildApp (/usr/local/lib/node_modules/@electron-forge/cli/node_modules/electron-packager/src/platform.js:136:5) at async MacApp.initialize (/usr/local/lib/node_modules/@electron-forge/cli/node_modules/electron-packager/src/platform.js:127:7) at async MacApp.create (/usr/local/lib/node_modules/@electron-forge/cli/node_modules/electron-packager/src/mac.js:377:5) at async Promise.all (index 0) at async packager (/usr/local/lib/node_modules/@electron-forge/cli/node_modules/electron-packager/src/index.js:204:20)

jhk0530 commented 1 year ago

You may run app file with terminal with permission

see trouble shooting in readme

electron-forge start work, but electron-forge make not work

It seems to be problem caused by permission, run .app file via terminal with sudo open ~~.app.

srmatth commented 1 year ago

I am getting the same error as @awosoga and the above fix does not work for me.

When I run the suggested fix from @jhk0530, I just get an error message telling me that ~~.app does not exist.

Looking back at the original error message, it seems that there is some issue with external references in the font files. Any thoughts on how to troubleshoot this would be much appreciated.

R Version Information:

> version
               _                           
platform       aarch64-apple-darwin20      
arch           aarch64                     
os             darwin20                    
system         aarch64, darwin20           
status                                     
major          4                           
minor          3.1                         
year           2023                        
month          06                          
day            16                          
svn rev        84548                       
language       R                           
version.string R version 4.3.1 (2023-06-16)
nickname       Beagle Scouts    

Electron Forge Version 6.4.1

awosoga commented 1 year ago

I have the same version of R, and sudo ~~.app does not work because the file is not created at all. The error is thrown before the process completes

jhk0530 commented 1 year ago

.app exists in <APP>/out/make/zip/darwin/arm64/ with zip file. You should open this zip file to extract .app

Here is example of mine. <askme>

스크린샷 2023-09-01 오전 9 08 48

and terminal commands to run app from electron-forge make

스크린샷 2023-09-01 오전 9 12 36
awosoga commented 1 year ago

This is what I'm saying - the out folder isn't created at all. From my understanding, the out folder is only created after electron-forge make runs successfully. Since the unhandled rejection from my initial post is thrown, compilation aborts and no folder is created

Screenshot 2023-09-01 at 10 56 47 AM

srmatth commented 1 year ago

I agree the out/ dir never gets created because the error happens before the app is actually made.

jhk0530 commented 1 year ago

I had the same problem, and chatGPT didn't help me solve the problem

스크린샷 2023-09-02 오전 9 27 41

Eventually, I tried 2 methods and it worked but, I don't think either of them are fundamental fixes.

  1. delete the r-mac/fontconfig/fonts/conf.d folder.
스크린샷 2023-09-02 오전 9 28 55
  1. allow read-write access to the children of the name directory to everyone (image contains korean, but you may understand)
스크린샷 2023-09-02 오전 9 26 24
jhk0530 commented 1 year ago

Hey guys, I found one possible solution. modify forge.config.js as below I tried and app didn't passed from loading screen. I thought it was access problem. But I found this solution from old legacy of my window pc

module.exports = {
  packagerConfig: {},
  rebuildConfig: {},
  makers: [
    {
      name: '@electron-forge/maker-zip',
      platforms: ['win32', 'darwin']
    }
  ]
};

Note. add appropriate makers as you wish .

awosoga commented 1 year ago

This solution worked for me. Thank you for your help!

jhk0530 commented 1 year ago

Nice, I'll update this.

Thanks.