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

Unhandled rejection SyntaxError: Unexpected token ... #1076

Closed
cheton opened this issue Jan 3, 2017 · 8 comments · May be fixed by qcif/data-curator#563
Closed

Unhandled rejection SyntaxError: Unexpected token ... #1076

cheton opened this issue Jan 3, 2017 · 8 comments · May be fixed by qcif/data-curator#563
Labels

Comments

@cheton
Copy link

cheton commented Jan 3, 2017

  • Version: 10.16.0
  • Target: Windows x64

I encountered the following error after upgrading electron-builder from 10.13.0 to 10.16.0. Rolling back to 10.13.0 can resolve this issue, and it only happened while packaging for Windows.

> [email protected] electron-builder /Users/cheton/github/cnc
> build "--win" "--x64"

Skip app dependencies rebuild because platform is different
⚠️  Packaging using asar archive is disabled — it is strongly not recommended.
Please enable asar and use asarUnpack to unpack files that must be externally available.
Packaging for win32 x64 using electron 1.4.13 to output/win-unpacked
Unhandled rejection SyntaxError: Unexpected token ...
SyntaxError: Unexpected token ...
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at HttpExecutorHolder.httpExecutor (/Users/cheton/github/cnc/node_modules/electron-builder-http/src/httpExecutor.ts:20:33)
    at download (/Users/cheton/github/cnc/node_modules/electron-builder-http/src/httpExecutor.ts:12:10)
    at /Users/cheton/github/cnc/node_modules/electron-builder/src/util/binDownload.ts:48:3
    at next (native)
    at [object Generator].tryCatcher (/Users/cheton/github/cnc/node_modules/bluebird/js/release/util.js:16:23)
    at PromiseSpawn._promiseFulfilled (/Users/cheton/github/cnc/node_modules/bluebird/js/release/generators.js:97:49)
    at Promise._settlePromise (/Users/cheton/github/cnc/node_modules/bluebird/js/release/promise.js:572:26)
    at Promise._settlePromise0 (/Users/cheton/github/cnc/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/Users/cheton/github/cnc/node_modules/bluebird/js/release/promise.js:691:18)
From previous event:
    at doGetBin (/Users/cheton/github/cnc/node_modules/electron-builder/out/util/binDownload.js:53:21)
    at getBin (/Users/cheton/github/cnc/node_modules/electron-builder/src/util/binDownload.ts:23:38)
    at getBinFromBintray (/Users/cheton/github/cnc/node_modules/electron-builder/src/util/binDownload.ts:13:10)
    at Object.<anonymous> (/Users/cheton/github/cnc/node_modules/electron-builder/src/targets/nsis.ts:26:25)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at /Users/cheton/github/cnc/node_modules/electron-builder/src/winPackager.ts:81:20
    at WinPackager.createTargets (/Users/cheton/github/cnc/node_modules/electron-builder/src/winPackager.ts:78:104)
    at createTargets (/Users/cheton/github/cnc/node_modules/electron-builder/src/targets/targetFactory.ts:36:12)
    at /Users/cheton/github/cnc/node_modules/electron-builder/src/packager.ts:146:41
From previous event:
    at Packager.doBuild (/Users/cheton/github/cnc/node_modules/electron-builder/out/packager.js:275:11)
    at /Users/cheton/github/cnc/node_modules/electron-builder/src/packager.ts:114:38
    at next (native)
    at processImmediate [as _immediateCallback] (timers.js:383:17)
From previous event:
    at Packager.build (/Users/cheton/github/cnc/node_modules/electron-builder/out/packager.js:227:11)
    at /Users/cheton/github/cnc/node_modules/electron-builder/src/builder.ts:249:40
    at next (native)
From previous event:
    at build (/Users/cheton/github/cnc/node_modules/electron-builder/out/builder.js:90:21)
    at Object.<anonymous> (/Users/cheton/github/cnc/node_modules/electron-builder/out/cli/build-cli.js:68:41)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:139:18)
    at node.js:974:3

SyntaxError: Unexpected token ...
SyntaxError: Unexpected token ...
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at HttpExecutorHolder.httpExecutor (/Users/cheton/github/cnc/node_modules/electron-builder-http/src/httpExecutor.ts:20:33)
    at download (/Users/cheton/github/cnc/node_modules/electron-builder-http/src/httpExecutor.ts:12:10)
    at /Users/cheton/github/cnc/node_modules/electron-builder/src/util/binDownload.ts:48:3
    at next (native)
    at [object Generator].tryCatcher (/Users/cheton/github/cnc/node_modules/bluebird/js/release/util.js:16:23)
    at PromiseSpawn._promiseFulfilled (/Users/cheton/github/cnc/node_modules/bluebird/js/release/generators.js:97:49)
    at Promise._settlePromise (/Users/cheton/github/cnc/node_modules/bluebird/js/release/promise.js:572:26)
    at Promise._settlePromise0 (/Users/cheton/github/cnc/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/Users/cheton/github/cnc/node_modules/bluebird/js/release/promise.js:691:18)
From previous event:
    at doGetBin (/Users/cheton/github/cnc/node_modules/electron-builder/out/util/binDownload.js:53:21)
    at getBin (/Users/cheton/github/cnc/node_modules/electron-builder/src/util/binDownload.ts:23:38)
    at getBinFromBintray (/Users/cheton/github/cnc/node_modules/electron-builder/src/util/binDownload.ts:13:10)
    at getSignVendorPath (/Users/cheton/github/cnc/node_modules/electron-builder/src/windowsCodeSign.ts:13:10)
    at /Users/cheton/github/cnc/node_modules/electron-builder/src/winPackager.ts:169:46
From previous event:
    at WinPackager.signAndEditResources (/Users/cheton/github/cnc/node_modules/electron-builder/out/winPackager.js:229:11)
    at /Users/cheton/github/cnc/node_modules/electron-builder/src/winPackager.ts:182:16
    at next (native)
    at processImmediate [as _immediateCallback] (timers.js:383:17)
From previous event:
    at WinPackager.postInitApp (/Users/cheton/github/cnc/node_modules/electron-builder/out/winPackager.js:238:11)
    at /Users/cheton/github/cnc/node_modules/electron-builder/src/platformPackager.ts:272:148
From previous event:
    at WinPackager.doPack (/Users/cheton/github/cnc/node_modules/electron-builder/out/platformPackager.js:324:11)
    at /Users/cheton/github/cnc/node_modules/electron-builder/src/platformPackager.ts:167:16
    at next (native)
From previous event:
    at WinPackager.pack (/Users/cheton/github/cnc/node_modules/electron-builder/out/platformPackager.js:219:11)
    at /Users/cheton/github/cnc/node_modules/electron-builder/src/packager.ts:146:22
From previous event:
    at Packager.doBuild (/Users/cheton/github/cnc/node_modules/electron-builder/out/packager.js:275:11)
    at /Users/cheton/github/cnc/node_modules/electron-builder/src/packager.ts:114:38
    at next (native)
    at processImmediate [as _immediateCallback] (timers.js:383:17)
From previous event:
    at Packager.build (/Users/cheton/github/cnc/node_modules/electron-builder/out/packager.js:227:11)
    at /Users/cheton/github/cnc/node_modules/electron-builder/src/builder.ts:249:40
    at next (native)
From previous event:
    at build (/Users/cheton/github/cnc/node_modules/electron-builder/out/builder.js:90:21)
    at Object.<anonymous> (/Users/cheton/github/cnc/node_modules/electron-builder/out/cli/build-cli.js:68:41)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:139:18)
    at node.js:974:3

npm ERR! Darwin 15.6.0
npm ERR! argv "/Users/cheton/.nvm/versions/node/v4.5.0/bin/node" "/Users/cheton/.nvm/versions/node/v4.5.0/bin/npm" "run" "electron-builder" "--" "--win" "--x64"
npm ERR! node v4.5.0
npm ERR! npm  v4.0.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] electron-builder: `build "--win" "--x64"`
npm ERR! Exit status 255
npm ERR!
npm ERR! Failed at the [email protected] electron-builder script 'build "--win" "--x64"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the cncjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     build "--win" "--x64"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs cncjs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls cncjs
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/cheton/github/cnc/npm-debug.log

npm ERR! Darwin 15.6.0
npm ERR! argv "/Users/cheton/.nvm/versions/node/v4.5.0/bin/node" "/Users/cheton/.nvm/versions/node/v4.5.0/bin/npm" "run" "build:win-x64"
npm ERR! node v4.5.0
npm ERR! npm  v4.0.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] build:win-x64: `bash -c 'scripts/electron-builder.sh --win --x64'`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build:win-x64 script 'bash -c 'scripts/electron-builder.sh --win --x64''.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the cncjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     bash -c 'scripts/electron-builder.sh --win --x64'
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs cncjs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls cncjs
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/cheton/github/cnc/npm-debug.log
@develar develar closed this as completed in 0c81bf7 Jan 3, 2017
@develar develar added the bug label Jan 3, 2017
@develar
Copy link
Member

develar commented Jan 3, 2017

Fixed in 10.17.1 In any case please consider to upgrade to latest LTS node release 6.9.2

@stefan-niedermann
Copy link

Is it possible that the same error appears again with version 13.3.2?
If i downgrade to 10.17.1 the build runs without problems, but with 13.3.2 i get the following stacktrace:

SyntaxError: Unexpected token ...
SyntaxError: Unexpected token ...
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at _load_CancellationToken (/home/xx/vscode-workspace/pdftk-ui/node_modules/electron-builder/out/builder.js:125
:33)
    at /home/xx/vscode-workspace/pdftk-ui/node_modules/electron-builder/src/builder.ts:206:29
    at next (native)
    at [object Generator].tryCatcher (/home/xx/vscode-workspace/pdftk-ui/node_modules/bluebird/js/release/util.js:1
6:23)
    at PromiseSpawn._promiseFulfilled (/home/xx/vscode-workspace/pdftk-ui/node_modules/bluebird/js/release/generato
rs.js:97:49)
    at /home/xx/vscode-workspace/pdftk-ui/node_modules/bluebird/js/release/generators.js:201:15
From previous event:
    at build (/home/xx/vscode-workspace/pdftk-ui/node_modules/electron-builder/out/builder.js:71:21)
    at Object.<anonymous> (/home/xx/vscode-workspace/pdftk-ui/node_modules/electron-builder/out/cli/build-cli.js:71
:41)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:139:18)
    at node.js:990:3
    npm ERR! Linux 3.16.0-4-amd64
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "dist"
npm ERR! node v4.7.2
npm ERR! npm  v4.0.5
npm ERR! code ELIFECYCLE
npm ERR! [email protected] dist: `build`
npm ERR! Exit status 255
npm ERR!
npm ERR! Failed at the [email protected] dist script 'build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the pdftk-ui package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs pdftk-ui
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls pdftk-ui
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/xx/vscode-workspace/pdftk-ui/npm-debug.log

@develar
Copy link
Member

develar commented Feb 10, 2017

@stefan-niedermann please try 13.5.0

@stefan-niedermann
Copy link

Sorry, same error as above. Shall i open a new seperate issue?

@develar
Copy link
Member

develar commented Feb 11, 2017

@stefan-niedermann NodeJS version?

@develar
Copy link
Member

develar commented Feb 11, 2017

@stefan-niedermann Error is clear. Will be published ASAP.

@develar
Copy link
Member

develar commented Feb 11, 2017

@stefan-niedermann for now please use node 7.

@stefan-niedermann
Copy link

okay, i am using an outdated node version (4.6.2) - updated to 7.5.0 - works. :) thanks.

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

Successfully merging a pull request may close this issue.

3 participants