vue-cli-plugin-tauri icon indicating copy to clipboard operation
vue-cli-plugin-tauri copied to clipboard

UnhandledPromiseRejectionWarning: Unhandled promise rejection

Open ozws opened this issue 4 years ago • 3 comments

Describe the bug A clear and concise description of what the bug is. Upon creating a new project, got the following at the end of tauri:build:

Bundling "/Volumes/MacHD2/apps/app-tauri-first/src-tauri/target/release/bundle/dmg/App First_0.1.0_x64.dmg"
info: running bundle_dmg.sh
Error: failed to bundle project

Caused by:
    Shell Scripting Error:`error running bundle_dmg.sh, try running with --verbose to see command output`

 app:spawn Command "/Volumes/MacHD2/apps/app-tauri-first/node_modules/@tauri-apps/cli/bin/tauri-cli" failed with exit code: 1 +0ms
(node:65482) UnhandledPromiseRejectionWarning: Error
    at d (/Volumes/MacHD2/apps/app-tauri-first/node_modules/@tauri-apps/cli/dist/api/cli.js:1:9485)
    at v (/Volumes/MacHD2/apps/app-tauri-first/node_modules/@tauri-apps/cli/dist/api/cli.js:1:9526)
    at ChildProcess.<anonymous> (/Volumes/MacHD2/apps/app-tauri-first/node_modules/@tauri-apps/cli/dist/api/cli.js:1:10657)
    at ChildProcess.emit (events.js:376:20)
    at maybeClose (internal/child_process.js:1055:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:65482) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:65482) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

To Reproduce Steps to reproduce the behavior: vue create my-new-tauri-app cd my-new-tauri-app vue add tauri yarn tauri:serve then yarn tauri:build

Environment (please complete the following information):

  • vue-cli-plugin-tauri version : 1.0.0-beta.2

  • other vue plugins used:

    • "@vue/cli-plugin-babel": "~4.5.0",
    • "@vue/cli-plugin-eslint": "~4.5.0",
    • "@vue/cli-plugin-pwa": "~4.5.0",
    • "@vue/cli-plugin-router": "~4.5.0",
    • "@vue/cli-plugin-vuex": "~4.5.0",
    • "@vue/cli-service": "~4.5.0",
    • "@vue/compiler-sfc": "^3.0.0",
  • output from npx tauri info/yarn tauri info:

Operating System - Mac OS, version 10.14.6 X64

Node.js environment
  Node.js - 14.17.0
  @tauri-apps/cli - 1.0.0-beta.1
  @tauri-apps/api - Not installed

Global packages
  npm - 6.14.13
  yarn - 1.22.10

Rust environment
  rustc - 1.52.1
  cargo - 1.52.0

App directory structure
/.git
/node_modules
/public
/src
/src-tauri

App
  tauri.rs - 1.0.0-beta.1
build-type - bundle
CSP - default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'
distDir - Set automatically by Vue CLI plugin
devPath - Set automatically by Vue CLI plugin
framework - Vue.js (Vue CLI)
bundler - Webpack

Additional context There may not be an issue in the actual app that is built. Would be more confident if it didn't have errors. I do not know exactly how to hunt the issue down myself.

ozws avatar Jun 19 '21 00:06 ozws

Hmmm.... interesting. After upgrading to Node.js 16.3.0 and using Terminal inside VSCode instead of iTerm (separately), I'm not getting the errors/warnings anymore on yarn tauri:build after creating new projects.

ozws avatar Jun 22 '21 04:06 ozws

That's weird, can you check what's the error output with --verbose?

lucasfernog avatar Jun 22 '21 04:06 lucasfernog

Here you go:

yarn run v1.22.10
$ vue-cli-service tauri:build --verbose

⠙  Building for production...

 DONE  Compiled successfully in 7863ms                                                                        4:29:43 PM

  File                                                          Size                       Gzipped

  src-tauri/target/webpack_dist/js/chunk-vendors.885263a8.js    123.15 KiB                 44.37 KiB
  src-tauri/target/webpack_dist/js/app.6be9ef95.js              6.42 KiB                   2.33 KiB
  src-tauri/target/webpack_dist/js/about.2b8983e6.js            0.34 KiB                   0.26 KiB
  src-tauri/target/webpack_dist/css/app.ab586865.css            0.42 KiB                   0.26 KiB

  Images and other types of assets omitted.

 DONE  Build complete. The src-tauri/target/webpack_dist directory is ready to be deployed.
 INFO  Check out deployment instructions at https://cli.vuejs.org/guide/deployment.html

 app:spawn Running "/Volumes/MacHD2/apps/testingggggg/node_modules/@tauri-apps/cli/bin/tauri-cli tauri build --config {"build":{"distDir":"./target/webpack_dist"}} --verbose" +0ms

   Compiling app v0.1.0 (/Volumes/MacHD2/apps/testingggggg/src-tauri)
    Finished release [optimized] target(s) in 57.11s
    Bundling Testing1.app
    Bundling "/Volumes/MacHD2/apps/testingggggg/src-tauri/target/release/bundle/dmg/Testing1_0.1.0_x64.dmg"
info: running bundle_dmg.sh
+ WINX=10
+ WINY=60
+ WINW=500
+ WINH=350
+ ICON_SIZE=128
+ TEXT_SIZE=16
+ FORMAT=UDZO
+ ADD_FILE_SOURCES=()
+ ADD_FILE_TARGETS=()
+ IMAGEKEY=
+ HDIUTIL_VERBOSITY=
+ SANDBOX_SAFE=0
+ SKIP_JENKINS=0
+ MAXIMUM_UNMOUNTING_ATTEMPTS=3
+ POSITION_CLAUSE=
+ HIDING_CLAUSE=
+ [[ - = \- ]]
+ case $1 in
+ VOLUME_NAME=Testing1
+ shift
+ shift
+ case $FORMAT in
+ IMAGEKEY='-imagekey zlib-level=9'
+ [[ - = \- ]]
+ case $1 in
+ POSITION_CLAUSE='set position of item "Testing1" to {180, 170}
		'
+ shift
+ shift
+ shift
+ shift
+ case $FORMAT in
+ IMAGEKEY='-imagekey zlib-level=9'
+ [[ - = \- ]]
+ case $1 in
+ APPLICATION_LINK=480
+ APPLICATION_CLAUSE='set position of item "Applications" to {480, 170}
		'
+ shift
+ shift
+ shift
+ case $FORMAT in
+ IMAGEKEY='-imagekey zlib-level=9'
+ [[ - = \- ]]
+ case $1 in
+ WINW=660
+ WINH=400
+ shift
+ shift
+ shift
+ case $FORMAT in
+ IMAGEKEY='-imagekey zlib-level=9'
+ [[ - = \- ]]
+ case $1 in
+ HIDING_CLAUSE='set the extension hidden of item "Testing1.app" to true
		'
+ shift
+ shift
+ case $FORMAT in
+ IMAGEKEY='-imagekey zlib-level=9'
+ [[ - = \- ]]
+ case $1 in
+ VOLUME_ICON_FILE=/Volumes/MacHD2/apps/testingggggg/src-tauri/target/release/bundle/dmg/icon.icns
+ shift
+ shift
+ case $FORMAT in
+ IMAGEKEY='-imagekey zlib-level=9'
+ [[ T = \- ]]
+ [[ -z Testing1.app ]]
+++ dirname /Volumes/MacHD2/apps/testingggggg/src-tauri/target/release/bundle/dmg/bundle_dmg.sh
++ cd /Volumes/MacHD2/apps/testingggggg/src-tauri/target/release/bundle/dmg
++ pwd
+ SCRIPT_DIR=/Volumes/MacHD2/apps/testingggggg/src-tauri/target/release/bundle/dmg
+ DMG_PATH=Testing1_0.1.0_x64.dmg
++ dirname Testing1_0.1.0_x64.dmg
+ DMG_DIRNAME=.
++ cd .
++ pwd
+ DMG_DIR=/Volumes/MacHD2/apps/testingggggg/src-tauri/target/release/bundle/macos
++ basename Testing1_0.1.0_x64.dmg
+ DMG_NAME=Testing1_0.1.0_x64.dmg
+ DMG_TEMP_NAME=/Volumes/MacHD2/apps/testingggggg/src-tauri/target/release/bundle/macos/rw.Testing1_0.1.0_x64.dmg
++ cd Testing1.app
++ pwd
+ SRC_FOLDER=/Volumes/MacHD2/apps/testingggggg/src-tauri/target/release/bundle/macos/Testing1.app
+ [[ .dmg != \.\d\m\g ]]
+ [[ -z Testing1 ]]
+ BREW_INSTALL=0
+ AUX_PATH=/Volumes/MacHD2/apps/testingggggg/src-tauri/target/release/bundle/dmg/support
+ '[' 0 -eq 0 ']'
+ test -d /Volumes/MacHD2/apps/testingggggg/src-tauri/target/release/bundle/dmg/support
+ [[ -f /Volumes/MacHD2/apps/testingggggg/src-tauri/target/release/bundle/macos/Testing1.app/.DS_Store ]]
+ echo 'Creating disk image...'
Creating disk image...
+ [[ -f /Volumes/MacHD2/apps/testingggggg/src-tauri/target/release/bundle/macos/rw.Testing1_0.1.0_x64.dmg ]]
+ rm -f /Volumes/MacHD2/apps/testingggggg/src-tauri/target/release/bundle/macos/rw.Testing1_0.1.0_x64.dmg
+ CUSTOM_SIZE=
+ [[ -n '' ]]
+ '[' 0 -eq 0 ']'
+ hdiutil create -srcfolder /Volumes/MacHD2/apps/testingggggg/src-tauri/target/release/bundle/macos/Testing1.app -volname Testing1 -fs HFS+ -fsargs '-c c=64,a=16,e=16' -format UDRW /Volumes/MacHD2/apps/testingggggg/src-tauri/target/release/bundle/macos/rw.Testing1_0.1.0_x64.dmg
.......................................................
created: /Volumes/MacHD2/apps/testingggggg/src-tauri/target/release/bundle/macos/rw.Testing1_0.1.0_x64.dmg
++ get_size /Volumes/MacHD2/apps/testingggggg/src-tauri/target/release/bundle/macos/rw.Testing1_0.1.0_x64.dmg
+++ du -s /Volumes/MacHD2/apps/testingggggg/src-tauri/target/release/bundle/macos/rw.Testing1_0.1.0_x64.dmg
+++ sed -e 's/	.*//g'
++ bytes_size=25208
+++ blocks_to_megabytes 25208
+++ MB_SIZE=13
+++ echo 13
++ echo 13
+ DISK_IMAGE_SIZE=13
+ [[ 0 -eq 1 ]]
+ [[ -n '' ]]
++ expr 13 + 20
+ DISK_IMAGE_SIZE=33
++ hdiutil resize -limits /Volumes/MacHD2/apps/testingggggg/src-tauri/target/release/bundle/macos/rw.Testing1_0.1.0_x64.dmg
++ awk 'NR=1{print int($1/2048+1)}'
+ MIN_DISK_IMAGE_SIZE=13
+ '[' 13 -gt 33 ']'
+ hdiutil resize -size 33m /Volumes/MacHD2/apps/testingggggg/src-tauri/target/release/bundle/macos/rw.Testing1_0.1.0_x64.dmg
+ echo 'Mounting disk image...'
Mounting disk image...
+ MOUNT_DIR=/Volumes/Testing1
+ [[ -d /Volumes/Testing1 ]]
+ echo 'Mounting disk image...'
Mounting disk image...
+ echo 'Mount directory: /Volumes/Testing1'
Mount directory: /Volumes/Testing1
++ hdiutil attach -readwrite -noverify -noautoopen /Volumes/MacHD2/apps/testingggggg/src-tauri/target/release/bundle/macos/rw.Testing1_0.1.0_x64.dmg
++ egrep --color=never '^/dev/'
++ sed 1q
++ awk '{print $1}'
+ DEV_NAME=/dev/disk13
+ echo 'Device name:     /dev/disk13'
Device name:     /dev/disk13
+ [[ -n '' ]]
+ [[ -n 480 ]]
+ echo 'making link to Applications dir'
making link to Applications dir
+ test -d /Volumes/Testing1/Applications
+ ln -s /Applications /Volumes/Testing1/Applications
+ [[ -n '' ]]
+ [[ -n /Volumes/MacHD2/apps/testingggggg/src-tauri/target/release/bundle/dmg/icon.icns ]]
+ echo 'Copying volume icon file '\''/Volumes/MacHD2/apps/testingggggg/src-tauri/target/release/bundle/dmg/icon.icns'\''...'
Copying volume icon file '/Volumes/MacHD2/apps/testingggggg/src-tauri/target/release/bundle/dmg/icon.icns'...
+ cp /Volumes/MacHD2/apps/testingggggg/src-tauri/target/release/bundle/dmg/icon.icns /Volumes/Testing1/.VolumeIcon.icns
+ SetFile -c icnC /Volumes/Testing1/.VolumeIcon.icns
+ [[ -n '' ]]
++ mktemp -t createdmg.tmp.XXXXXXXXXX
+ APPLESCRIPT_FILE=/var/folders/jd/h66ntl0s3xn5srklns_v7jfw0000gn/T/createdmg.tmp.XXXXXXXXXX.WVAbbmB3
+ [[ 0 -eq 1 ]]
+ [[ 0 -eq 0 ]]
+ applescript_source
+ '[' 0 -eq 0 ']'
+ cat /Volumes/MacHD2/apps/testingggggg/src-tauri/target/release/bundle/dmg/support/template.applescript
+ sed -e s/WINX/10/g -e s/WINY/60/g -e s/WINW/660/g -e s/WINH/400/g -e s/BACKGROUND_CLAUSE//g -e s/REPOSITION_HIDDEN_FILES_CLAUSE//g -e s/ICON_SIZE/128/g -e s/TEXT_SIZE/16/g
+ perl -pe 's/POSITION_CLAUSE/set position of item "Testing1" to {180, 170}
		/g'
+ perl -pe s/QL_CLAUSE//g
+ perl -pe 's/APPLICATION_CLAUSE/set position of item "Applications" to {480, 170}
		/g'
+ perl -pe 's/HIDING_CLAUSE/set the extension hidden of item "Testing1.app" to true
		/'
+ sleep 2
+ echo 'Running AppleScript to make Finder stuff pretty: /usr/bin/osascript "/var/folders/jd/h66ntl0s3xn5srklns_v7jfw0000gn/T/createdmg.tmp.XXXXXXXXXX.WVAbbmB3" "Testing1"'
Running AppleScript to make Finder stuff pretty: /usr/bin/osascript "/var/folders/jd/h66ntl0s3xn5srklns_v7jfw0000gn/T/createdmg.tmp.XXXXXXXXXX.WVAbbmB3" "Testing1"
+ /usr/bin/osascript /var/folders/jd/h66ntl0s3xn5srklns_v7jfw0000gn/T/createdmg.tmp.XXXXXXXXXX.WVAbbmB3 Testing1
/var/folders/jd/h66ntl0s3xn5srklns_v7jfw0000gn/T/createdmg.tmp.XXXXXXXXXX.WVAbbmB3:394:406: execution error: Not authorized to send Apple events to Finder. (-1743)
+ echo 'Failed running AppleScript'
Failed running AppleScript
+ hdiutil detach /dev/disk13
"disk13" ejected.
+ exit 64
Error: failed to bundle project

Caused by:
    Shell Scripting Error:`error running bundle_dmg.sh`

Looks like it's not getting past the AppleScript? Hmm.... when running in VSCode with Terminal, VSCode did ask me for permission to access something (probably FInder), I said Yes.

Does that AppleScript even need to run at all? Not sure what it is doing. Seems the app is still generated properly. Perhaps be able to pass a flag to skip that part?

Again, hmm......

ozws avatar Jun 24 '21 21:06 ozws