Error on `quasar build --mode electron --target win32`
stevendesu last edited by
I was just playing around with Quasar to see if I liked it and wanted to test the out-of-the-box support for Electron. I fired up a new app and immediately had errors:
$> npm install -g @quasar/cli $> quasar create test-app $> cd test-app $> quasar build --mode electron --target win32
I made no changes to the starting code. After the long build process, I was met with this error:
app:electron Bundling app with electron-packager... +3ms (node:21956) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'version' of undefined - index.js:119 Promise [test-app]/[@quasar]/app/lib/electron/index.js:119:56 - new Promise - index.js:112 Promise.then.then [test-app]/[@quasar]/app/lib/electron/index.js:112:14 - next_tick.js:68 process._tickCallback internal/process/next_tick.js:68:7 (node:21956) 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(). (rejection id: 2) (node:21956) [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.
I was able to accidentally resolve this error by installing Jest:
$> quasar ext add @quasar/testing (select only Jest, and configure however you want) $> quasar build --mode electron --target win32
I haven’t done exhaustive testing. Maybe you can install any testing framework and it fixes it. Maybe you can install any app extension and it fixes it (not just testing frameworks). Maybe running any non-build quasar command before running quasar build fixes it. Whatever the case, the error goes away after installing Jest.