quasarframework / quasar

Quasar Framework - Build high-performance VueJS user interfaces in record time
https://quasar.dev
MIT License
25.9k stars 3.51k forks source link

quasar build -m cordova -T browser fails #6978

Closed oal closed 4 years ago

oal commented 4 years ago

Describe the bug Building a Quasar app in Cordova mode with the browser target fails because any other target than Android expects src-cordova/platforms/ios/build/emulator to exist: https://github.com/quasarframework/quasar/blob/dev/app/lib/cordova/index.js#L68

Codepen/jsFiddle/Codesandbox (required) N/A. This is related to the Quasar CLI.

To Reproduce

  1. Create a Quasar app
  2. Run quasar build -m cordova -T browser

Crashes with:

(node:27903) UnhandledPromiseRejectionWarning:   Error: ENOENT: no such file or directory, stat '.../testapp/src-cordova/platforms/ios/build/emulator'

  - polyfills.js:307 Object.statSync
    [testapp]/[graceful-fs]/polyfills.js:307:34

  - stat.js:10 statSync
    [testapp]/[fs-extra]/lib/util/stat.js:10:52

  - stat.js:24 getStatsSync
    [testapp]/[fs-extra]/lib/util/stat.js:24:19

  - stat.js:49 Object.checkPathsSync
    [testapp]/[fs-extra]/lib/util/stat.js:49:33

  - copy-sync.js:24 Object.copySync
    [testapp]/[fs-extra]/lib/copy-sync/copy-sync.js:24:38

  - index.js:94 CordovaRunner.build
    [testapp]/[@quasar]/app/lib/cordova/index.js:94:9

  - task_queues.js:86 processTicksAndRejections
    internal/process/task_queues.js:86:5

Expected behavior The built app should be output to dist/cordova/browser.

Platform (please complete the following information): OS: Ubuntu 19.10 Node: v14.2.0 NPM: 6.9.0 Yarn: Browsers: iOS: Android: Electron:

Additional context This issue most likely exists for any of the other Cordova targets besides iOS and Android:

  Options
    --mode, -m      App mode [spa|ssr|pwa|cordova|capacitor|electron|bex] (default: spa)
    --target, -T    App target
                      - Cordova (default: all installed)
                        [android|ios|blackberry10|browser|osx|ubuntu|webos|windows]
rstoenescu commented 4 years ago

Hi,

We are sorry but we only support android and ios as targets. There is no point in supporting the browser target since you can run directly on an emulator or a real phone/tablet and still have access to dev tools and HMR.

oal commented 4 years ago

I understand, although there is some value to using a single code base, and Cordova plugins in the browser as well.

The "App target" portion of the CLI output should be updated though, to only show "android" and "ios".

rstoenescu commented 4 years ago

Agreed. Updated. Thought it was mentioning this clearly already.