No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Using electron-packager to build Quasar project - App doesn't start

    Help
    3
    7
    1345
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      cynderkromi last edited by

      I am trying to run the builder as referenced on the Quasar website:

      quasar build -m electron
      

      But when I run it then run my .app file (I’m on a Mac) electron just bounces for a little then terminates. I don’t get an error message.

      Where can I find the log that will tell me what’s going on?

      I’ve been Googling and have tried various things but nothing has worked so far. This is my quasar.conf.js file if that helps. I don’t know what to put under the packager {} area, there are not good instructions on the electron-packager documentation page.

      Thanks!

      /*
       * This file runs in a Node context (it's NOT transpiled by Babel), so use only
       * the ES6 features that are supported by your Node version. https://node.green/
       */
      
      // Configuration for your app
      // https://quasar.dev/quasar-cli/quasar-conf-js
      
      module.exports = function (/* ctx */) {
        return {
          // https://quasar.dev/quasar-cli/supporting-ts
          supportTS: false,
      
          // https://quasar.dev/quasar-cli/prefetch-feature
          // preFetch: true,
      
          // app boot file (/src/boot)
          // --> boot files are part of "main.js"
          // https://quasar.dev/quasar-cli/boot-files
          boot: [
            
          ],
      
          // https://quasar.dev/quasar-cli/quasar-conf-js#Property%3A-css
          css: [
            'app.sass'
          ],
      
          // https://github.com/quasarframework/quasar/tree/dev/extras
          extras: [
            // 'ionicons-v4',
            // 'mdi-v5',
            // 'fontawesome-v5',
            // 'eva-icons',
            // 'themify',
             'line-awesome',
            // 'roboto-font-latin-ext', // this or either 'roboto-font', NEVER both!
      
            'roboto-font', // optional, you are not bound to it
            'material-icons', // optional, you are not bound to it
          ],
      
          // Full list of options: https://quasar.dev/quasar-cli/quasar-conf-js#Property%3A-build
          build: {
            vueRouterMode: 'hash', // available values: 'hash', 'history'
      
            // transpile: false,
      
            // Add dependencies for transpiling with Babel (Array of string/regex)
            // (from node_modules, which are by default not transpiled).
            // Applies only if "transpile" is set to true.
            // transpileDependencies: [],
      
            // rtl: false, // https://quasar.dev/options/rtl-support
            // preloadChunks: true,
            // showProgress: false,
            // gzip: true,
            // analyze: true,
      
            // Options below are automatically set depending on the env, set them if you want to override
            // extractCSS: false,
      
            // https://quasar.dev/quasar-cli/handling-webpack
            extendWebpack (cfg) {
            },
          },
      
          // Full list of options: https://quasar.dev/quasar-cli/quasar-conf-js#Property%3A-devServer
          devServer: {
            https: false,
            port: 8080,
            open: true // opens browser window automatically
          },
      
          // https://quasar.dev/quasar-cli/quasar-conf-js#Property%3A-framework
          framework: {
            iconSet: 'material-icons', // Quasar icon set
            cssAddon: true, // this allows additioonal formatting such as center
            lang: 'en-us', // Quasar language pack
            config: {
              notify: { /* look at QUASARCONFOPTIONS from the API card (bottom of page) */ }
            },
      
            // Possible values for "importStrategy":
            // * 'auto' - (DEFAULT) Auto-import needed Quasar components & directives
            // * 'all'  - Manually specify what to import
            importStrategy: 'auto',
      
            // For special cases outside of where "auto" importStrategy can have an impact
            // (like functional components as one of the examples),
            // you can manually specify Quasar components/directives to be available everywhere:
            //
            // components: [],
            // directives: [],
      
            // Quasar plugins
            plugins: [
              'Notify'
            ]
          },
      
          // animations: 'all', // --- includes all animations
          // https://quasar.dev/options/animations
          animations: [],
      
          // https://quasar.dev/quasar-cli/developing-ssr/configuring-ssr
          ssr: {
            pwa: false
          },
      
          // https://quasar.dev/quasar-cli/developing-pwa/configuring-pwa
          pwa: {
            workboxPluginMode: 'GenerateSW', // 'GenerateSW' or 'InjectManifest'
            workboxOptions: {}, // only for GenerateSW
            manifest: {
              name: `Paw Tap Secretarial Software`,
              short_name: `Paw Tap`,
              description: `Paw Tap Quasar`,
              display: 'standalone',
              orientation: 'portrait',
              background_color: '#ffffff',
              theme_color: '#027be3',
              icons: [
                {
                  src: 'icons/icon-128x128.png',
                  sizes: '128x128',
                  type: 'image/png'
                },
                {
                  src: 'icons/icon-192x192.png',
                  sizes: '192x192',
                  type: 'image/png'
                },
                {
                  src: 'icons/icon-256x256.png',
                  sizes: '256x256',
                  type: 'image/png'
                },
                {
                  src: 'icons/icon-384x384.png',
                  sizes: '384x384',
                  type: 'image/png'
                },
                {
                  src: 'icons/icon-512x512.png',
                  sizes: '512x512',
                  type: 'image/png'
                }
              ]
            }
          },
      
          // Full list of options: https://quasar.dev/quasar-cli/developing-cordova-apps/configuring-cordova
          cordova: {
            // noIosLegacyBuildFlag: true, // uncomment only if you know what you are doing
          },
      
          // Full list of options: https://quasar.dev/quasar-cli/developing-capacitor-apps/configuring-capacitor
          capacitor: {
            hideSplashscreen: true
          },
      
          // Full list of options: https://quasar.dev/quasar-cli/developing-electron-apps/configuring-electron
          electron: {
            bundler: 'packager', // 'packager' or 'builder'
      
            packager: {
              // https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#options
      
              //OS X / Mac App Store
              // appBundleId: '',
              // appCategoryType: '',
              // osxSign: '',
              // protocol: 'myapp://path',
      
              // Windows only
              // win32metadata: { ... }
            },
      
            builder: {
              // https://www.electron.build/configuration/configuration
      
              appId: 'PawTap'
            },
      
            // More info: https://quasar.dev/quasar-cli/developing-electron-apps/node-integration
            nodeIntegration: true,
      
            extendWebpack (/* cfg */) {
              // do something with Electron main process Webpack cfg
              // chainWebpack also available besides this extendWebpack
            }
          }
        }
      }
      
      
      1 Reply Last reply Reply Quote 0
      • mYnDstrEAm
        mYnDstrEAm last edited by

        Have you tried running it from the console to see error messages there?

        C 1 Reply Last reply Reply Quote 0
        • C
          cynderkromi @mYnDstrEAm last edited by cynderkromi

          @mYnDstrEAm When I ran the .app file this morning I did get an error screen on the Mac. That my app quit unexpectedly. I’m including the super huge error report, I don’t even know what I should be looking for.

          When I run the app using quasar dev -m electron it runs just fine.

          Process:               Paw Tap [80537]
          Path:                  /Users/USER/*/Paw Tap.app/Contents/MacOS/Paw Tap
          Identifier:            com.electron.paw-tap
          Version:               0.0.1 (0.0.1)
          Code Type:             X86-64 (Native)
          Parent Process:        ??? [1]
          Responsible:           Paw Tap [80537]
          User ID:               501
          
          Date/Time:             2021-01-12 10:07:27.034 -0700
          OS Version:            macOS 11.1 (20C69)
          Report Version:        12
          Anonymous UUID:        1ED30C54-E28B-2118-F97A-49CF41E219CE
          
          Sleep/Wake UUID:       F1D95E9B-5BF9-4BC1-9BE9-5244FAF737BD
          
          Time Awake Since Boot: 320000 seconds
          Time Since Wake:       6600 seconds
          
          System Integrity Protection: enabled
          
          Crashed Thread:        10  Chrome_IOThread
          
          Exception Type:        EXC_BREAKPOINT (SIGTRAP)
          Exception Codes:       0x0000000000000002, 0x0000000000000000
          Exception Note:        EXC_CORPSE_NOTIFY
          
          Termination Signal:    Trace/BPT trap: 5
          Termination Reason:    Namespace SIGNAL, Code 0x5
          Terminating Process:   exc handler [80537]
          
          (cut out a bunch)
          
          
          External Modification Summary:
            Calls made by other processes targeting this process:
              task_for_pid: 0
              thread_create: 0
              thread_set_state: 0
            Calls made by this process:
              task_for_pid: 0
              thread_create: 0
              thread_set_state: 0
            Calls made by all processes on this machine:
              task_for_pid: 307955
              thread_create: 0
              thread_set_state: 0
          
          VM Region Summary:
          ReadOnly portion of Libraries: Total=968.6M resident=0K(0%) swapped_out_or_unallocated=968.6M(100%)
          Writable regions: Total=682.1M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=682.1M(100%)
           
                                          VIRTUAL   REGION 
          REGION TYPE                        SIZE    COUNT (non-coalesced) 
          ===========                     =======  ======= 
          Activity Tracing                   256K        1 
          Kernel Alloc Once                    8K        1 
          MALLOC                           166.6M       26 
          MALLOC guard page                   16K        3 
          MALLOC_NANO (reserved)           384.0M        1         reserved VM address space (unallocated)
          Memory Tag 255                     4.0G       32 
          STACK GUARD                       56.1M       22 
          Stack                            122.7M       22 
          VM_ALLOCATE                       1056K       16 
          __CTF                               759        1 
          __DATA                            30.4M      474 
          __DATA_CONST                      24.8M      293 
          __DATA_DIRTY                      1694K      204 
          __FONT_DATA                          4K        1 
          __LINKEDIT                       491.4M        9 
          __OBJC_RO                         60.5M        1 
          __OBJC_RW                         2452K        2 
          __TEXT                           477.2M      471 
          __UNICODE                          588K        1 
          mapped file                      717.9M       17 
          shared memory                       40K        4 
          ===========                     =======  ======= 
          TOTAL                              6.5G     1602 
          TOTAL, minus reserved VM space     6.1G     1602 
          
          Model: MacBookPro14,1, BootROM 429.60.3.0.0, 2 processors, Dual-Core Intel Core i7, 2.5 GHz, 16 GB, SMC 2.43f10
          Graphics: kHW_IntelIrisGraphics640Item, Intel Iris Plus Graphics 640, spdisplays_builtin
          Memory Module: BANK 0/DIMM0, 8 GB, LPDDR3, 2133 MHz, 0x80CE, 0x4B3445424533303445422D45474347202020
          Memory Module: BANK 1/DIMM0, 8 GB, LPDDR3, 2133 MHz, 0x80CE, 0x4B3445424533303445422D45474347202020
          AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x170), Broadcom BCM43xx 1.0 (7.77.111.1 AirPortDriverBrcmNIC-1675.1)
          Bluetooth: Version 8.0.2f9, 3 services, 27 devices, 1 incoming serial ports
          Network Service: Wi-Fi, AirPort, en0
          USB Device: USB 3.0 Bus
          Thunderbolt Bus: MacBook Pro, Apple Inc., 41.4
          
          
          
          
          .....
          metalsadman 1 Reply Last reply Reply Quote 0
          • metalsadman
            metalsadman @cynderkromi last edited by

            @cynderkromi try the build command with the --debug flag, see if you can get a meaningful error logs.

            1 Reply Last reply Reply Quote 0
            • C
              cynderkromi last edited by

              Will try that thanks.

              This is my package.json file if it helps

              {
                "name": "paw-tap",
                "version": "0.0.1",
                "description": "Paw Tap Secretarial Software",
                "productName": "Paw Tap",
                "author": "Cynthia Heyman",
                "private": true,
                "scripts": {
                  "test": "echo \"No test specified\" && exit 0",
                  "start": "electron-forge start",
                  "package": "electron-forge package",
                  "make": "electron-forge make"
                },
                "files": [
                  "*.js",
                  "build",
                  "node_modules"
                ],
                "dependencies": {
                  "@quasar/cli": "^1.1.3",
                  "@quasar/extras": "^1.0.0",
                  "core-js": "^3.6.5",
                  "dexie": "^3.1.0-alpha.6",
                  "dexie-export-import": "^1.0.0",
                  "electron-compile": "^6.4.4",
                  "electron-squirrel-startup": "^1.0.0",
                  "line-awesome": "^1.3.0",
                  "localbase": "^0.7.4",
                  "quasar": "^1.0.0",
                  "electron-prebuilt-compile": "8.2.0"
                },
                "devDependencies": {
                  "@quasar/app": "^2.0.0",
                  "babel-plugin-transform-async-to-generator": "^6.24.1",
                  "babel-preset-env": "^1.7.0",
                  "babel-preset-react": "^6.24.1",
                  "devtron": "^1.4.0",
                  "electron": "^11.1.1",
                  "electron-debug": "^3.2.0",
                  "electron-devtools-installer": "^3.1.1",
                  "electron-forge": "^5.2.4",
                  "electron-prebuilt-compile": "8.2.0"
                },
                "browserslist": [
                  "last 10 Chrome versions",
                  "last 10 Firefox versions",
                  "last 4 Edge versions",
                  "last 7 Safari versions",
                  "last 8 Android versions",
                  "last 8 ChromeAndroid versions",
                  "last 8 FirefoxAndroid versions",
                  "last 10 iOS versions",
                  "last 5 Opera versions"
                ],
                "engines": {
                  "node": ">= 10.18.1",
                  "npm": ">= 6.13.4",
                  "yarn": ">= 1.21.1"
                },
                "main": "",
                "config": {
                  "forge": {
                    "make_targets": {
                      "win32": [
                        "squirrel"
                      ],
                      "darwin": [
                        "zip"
                      ],
                      "linux": [
                        "deb",
                        "rpm"
                      ]
                    },
                    "electronPackagerConfig": {
                      "packageManager": "npm"
                    },
                    "electronWinstallerConfig": {
                      "name": "paw_tap"
                    },
                    "electronInstallerDebian": {},
                    "electronInstallerRedhat": {},
                    "github_repository": {
                      "owner": "",
                      "name": ""
                    },
                    "windowsStoreConfig": {
                      "packageName": "",
                      "name": "Paw Tap"
                    }
                  }
                }
              }
              
              
              1 Reply Last reply Reply Quote 0
              • C
                cynderkromi last edited by

                Apparently, the problem was with my package.json file. I changed it to this and now the .app file is running. I do wish there was more detailed information on how and why and what to put in the package.json file, if anyone has a good detailed tutorial please let me know.

                {
                  "name": "paw-tap",
                  "version": "0.0.1",
                  "description": "Paw Tap Secretarial Software",
                  "productName": "Paw Tap",
                  "author": "Cynthia Heyman",
                  "private": true,
                  "scripts": {
                    "test": "echo \"No test specified\" && exit 0",
                    "start": "electron-forge start",
                    "package": "electron-forge package",
                    "make": "electron-forge make"
                  },
                  "build": {
                    "files": [
                      "app/**/*",
                      "node_modules/**/*",
                      "package.json"
                    ],
                    "appId": "com.myapp.PawTap",
                    "publish": {
                      "provider": "github",
                      "repo": "xxx",
                      "owner": "xxx"
                    },
                    "npmRebuild": false,
                    "directories": {
                      "buildResources": "assets"
                    },
                    "mac": {
                      "target": "dmg"
                    },
                    "win": {
                      "target": "nsis"
                    }
                  },
                  "dependencies": {
                    "@quasar/cli": "^1.1.3",
                    "@quasar/extras": "^1.0.0",
                    "core-js": "^3.6.5",
                    "dexie": "^3.1.0-alpha.6",
                    "dexie-export-import": "^1.0.0",
                    "electron-compile": "^6.4.4",
                    "electron-squirrel-startup": "^1.0.0",
                    "line-awesome": "^1.3.0",
                    "localbase": "^0.7.4",
                    "quasar": "^1.0.0",
                    "electron-prebuilt-compile": "8.2.0"
                  },
                  "devDependencies": {
                    "@quasar/app": "^2.0.0",
                    "babel-plugin-transform-async-to-generator": "^6.24.1",
                    "babel-preset-env": "^1.7.0",
                    "babel-preset-react": "^6.24.1",
                    "devtron": "^1.4.0",
                    "electron": "^11.1.1",
                    "electron-debug": "^3.2.0",
                    "electron-devtools-installer": "^3.1.1",
                    "electron-forge": "^5.2.4",
                    "electron-packager": "^15.2.0",
                    "electron-prebuilt-compile": "8.2.0"
                  },
                  "browserslist": [
                    "last 10 Chrome versions",
                    "last 10 Firefox versions",
                    "last 4 Edge versions",
                    "last 7 Safari versions",
                    "last 8 Android versions",
                    "last 8 ChromeAndroid versions",
                    "last 8 FirefoxAndroid versions",
                    "last 10 iOS versions",
                    "last 5 Opera versions"
                  ],
                  "engines": {
                    "node": ">= 10.18.1",
                    "npm": ">= 6.13.4",
                    "yarn": ">= 1.21.1"
                  },
                  "main": "",
                  "config": {
                    "forge": {
                      "make_targets": {
                        "win32": [
                          "squirrel"
                        ],
                        "darwin": [
                          "zip"
                        ],
                        "linux": [
                          "deb",
                          "rpm"
                        ]
                      },
                      "electronPackagerConfig": {
                        "packageManager": "npm"
                      },
                      "electronWinstallerConfig": {
                        "name": "paw_tap"
                      },
                      "electronInstallerDebian": {},
                      "electronInstallerRedhat": {},
                      "github_repository": {
                        "owner": "",
                        "name": ""
                      },
                      "windowsStoreConfig": {
                        "packageName": "",
                        "name": "Paw Tap"
                      }
                    }
                  }
                }
                
                
                metalsadman 1 Reply Last reply Reply Quote 0
                • metalsadman
                  metalsadman @cynderkromi last edited by

                  @cynderkromi i don’t think you need to tinker with electron config manually in your package.json, https://quasar.dev/quasar-cli/developing-electron-apps/configuring-electron#Introduction.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post