Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build process hangs on 'packaging' #3037

Closed
LukaszGrela opened this issue Jun 25, 2018 · 11 comments
Closed

Build process hangs on 'packaging' #3037

LukaszGrela opened this issue Jun 25, 2018 · 11 comments
Labels

Comments

@LukaszGrela
Copy link

LukaszGrela commented Jun 25, 2018

  • Version: 20.16.0
  • Target: Windows

I am trying to wrap React (CRA based) project with electron and it worked just fine:) untill this morning when the building process hanged on the 'packaging' step, when I've terminated the process following error appeared:

Error: C:\project\node_modules\app-builder-bin\win\x64\app-builder.exe exited with code 2 at ChildProcess.childProcess.once.code (C:\project\node_modules\builder-util\src\util.ts:251:14) at Object.onceWrapper (events.js:317:30) at emitTwo (events.js:126:13) at ChildProcess.emit (events.js:214:7) at maybeClose (internal/child_process.js:925:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) From previous event: at copyNodeModules (C:\project\node_modules\electron-builder-lib\out\util\AppFileCopierHelper.js:321:18) at C:\project\node_modules\electron-builder-lib\src\platformPackager.ts:261:42 at Generator.next (<anonymous>) From previous event: at then (C:\project\node_modules\electron-builder-lib\src\platformPackager.ts:257:14) From previous event: at _computeFileSets (C:\project\node_modules\electron-builder-lib\src\platformPackager.ts:258:10) at WinPackager.copyAppFiles (C:\project\node_modules\electron-builder-lib\src\platformPackager.ts:280:27) at C:\project\node_modules\electron-builder-lib\src\platformPackager.ts:214:10 at Generator.next (<anonymous>) at runCallback (timers.js:794:20) at tryOnImmediate (timers.js:752:5) at processImmediate [as _immediateCallback] (timers.js:729:5) From previous event: at WinPackager.doPack (C:\project\node_modules\electron-builder-lib\src\platformPackager.ts:162:151) at C:\project\node_modules\electron-builder-lib\src\platformPackager.ts:117:16 at Generator.next (<anonymous>) From previous event: at WinPackager.pack (C:\project\node_modules\electron-builder-lib\src\platformPackager.ts:115:95) at C:\project\node_modules\electron-builder-lib\src\packager.ts:379:24 at Generator.next (<anonymous>) at xfs.stat (C:\project\node_modules\fs-extra-p\node_modules\fs-extra\lib\mkdirs\mkdirs.js:56:16) at C:\project\node_modules\graceful-fs\polyfills.js:287:18 at FSReqWrap.oncomplete (fs.js:153:5) From previous event: at Packager.doBuild (C:\project\node_modules\electron-builder-lib\src\packager.ts:347:39) at C:\project\node_modules\electron-builder-lib\src\packager.ts:323:52 at Generator.next (<anonymous>) at C:\project\node_modules\graceful-fs\graceful-fs.js:99:16 at C:\project\node_modules\graceful-fs\graceful-fs.js:43:10 at FSReqWrap.oncomplete (fs.js:135:15) From previous event: at Packager._build (C:\project\node_modules\electron-builder-lib\src\packager.ts:300:133) at C:\project\node_modules\electron-builder-lib\src\packager.ts:296:23 at Generator.next (<anonymous>) at runCallback (timers.js:794:20) at tryOnImmediate (timers.js:752:5) at processImmediate [as _immediateCallback] (timers.js:729:5) From previous event: at Packager.build (C:\project\node_modules\electron-builder-lib\src\packager.ts:254:14) at C:\project\node_modules\electron-builder-lib\src\index.ts:51:40 at Generator.next (<anonymous>) From previous event: at build (C:\project\node_modules\electron-builder-lib\out\index.js:220:17) at build (C:\project\node_modules\electron-builder\src\builder.ts:234:10) at then (C:\project\node_modules\electron-builder\src\cli\cli.ts:46:19) at <anonymous>

$ build -c.extraMetadata.main=build/electron.js
• electron-builder version=20.16.0
• loaded configuration file=package.json ("build" field)
• loaded parent configuration preset=react-cra
• description is missed in the package.json appPackageFile=C:\dev\reactjs\KioskUI\UserInterface\package.json
• writing effective config file=dist\electron-builder-effective-config.yaml
• rebuilding native production dependencies platform=win32 arch=x64
• rebuilding native dependency name=node-sass
• packaging platform=win32 arch=x64 electron=2.0.3 appOutDir=dist\win-unpacked

@riptl
Copy link

riptl commented Jun 25, 2018

I have the same problem and I've found the cause after 30 minutes of debugging! This is Windows specific. The problem is in the app-builder-bin module.
I am using Windows 10.

It hangs on the app-builder-bin node-dep-tree task, which should normally execute really quickly.
Relative paths work, but full paths including the disk identifier (C:\) seem to hang.

Working:

PS C:\Users\Me> app-builder-bin node-dep-tree --dir .\electron-project
 ➡ *success*

Hanging:

PS C:\Users\Me> app-builder-bin node-dep-tree --dir C:\Users\Me\electron-project
 ➡ *HANG*

SysInternals ProcessExplorer confirms that app-builder-bin is executed with an absolute path.

EDIT: Ok, I'm not the first one to find this develar/app-builder#2

@riptl
Copy link

riptl commented Jun 25, 2018

Until the issue in app-builder is fixed, the path can be converted to relative as a workaround.

NOTE: Replace it in the .js file, not the .ts one!
The line is in node_modules/electron-builder-lib/out/util/AppFileCopierHelper.js

@riptl
Copy link

riptl commented Jun 25, 2018

My fix seems to work for now.
Can someone please rewrite nodeModules/tree.go? https://github.com/develar/app-builder/blob/6900b354ea36e2e68800d34ef939a37908127622/pkg/nodeModules/tree.go#L258
This is where the hang occurs.
I updated the issue in develar/app-builder#2

@riptl
Copy link

riptl commented Jun 26, 2018

Yay! I fixed it: develar/app-builder#3

Please pull asap.

@develar develar added the bug label Jun 26, 2018
@damianobarbati
Copy link

@terorie I still get this hanging here:

  • spawning        command=/Users/damiano/Desktop/tav-client/node_modules/app-builder-bin/mac/app-builder node-dep-tree --dir /Users/damiano/Desktop/tav-client

Versions (everything to lastest):

    "dependencies": {
        "@sentry/electron": "^0.5.5",
        "auto-launch": "^5.0.5",
        "axios": "^0.18.0",
        "better-console": "^1.0.1",
        "electron-log": "^2.2.15",
        "electron-updater": "^2.22.0",
        "lodash": "^4.17.10",
        "luxon": "^1.2.1",
        "mz": "^2.7.0",
        "sleep-promise": "^8.0.1",
        "typeface-montserrat": "^0.0.54",
        "ws": "^5.1.1"
    },
    "devDependencies": {
        "babel-eslint": "^8.2.3",
        "electron": "^2.0.3",
        "electron-builder": "^20.16.1",
        "electron-debug": "^2.0.0",
        "electron-reload": "^1.2.3",
        "eslint": "^5.0.1",
        "eslint-loader": "^2.0.0",
        "eslint-plugin-jest": "^21.15.0",
        "eslint-plugin-react": "^7.7.0",
        "png2icns": "^0.0.1"
    }

What should I do? :(

@develar
Copy link
Member

develar commented Jun 26, 2018

@damianobarbati Will be fixed soon.

@riptl
Copy link

riptl commented Jun 26, 2018

I'm amazed how fast this got fixed

@ahmedkamalio
Copy link

I'm facing this issue on Ubuntu machine how to fix it?!!

@17biubiu
Copy link

17biubiu commented Mar 4, 2019

me too. when i run npm run build:win (electron-builder --win --x64) on mac。 i am facing this issue

@17biubiu
Copy link

17biubiu commented Mar 4, 2019

i have solve it. when i delete node_modules and npm clear cache --force. then npm install && npm run build:win, it is becomes ok. amazing!

@yanlee26
Copy link

⨯ macOS Catalina doesn't support 32-bit executables and as result Wine cannot run Windows 32-bit applications too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants