quasarframework / quasar

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

Quasar build fails with latest cordova-ios #17138

Closed w0pp closed 1 week ago

w0pp commented 1 week ago

What happened?

When running quasar build -m ios, the build fails when Quasar tries to copy platforms/ios/build/emulator to the dist/ folder. This is because cordova-ios@7.0.0 changed the location of where the output files are generated - see the release notes.

What did you expect to happen?

Build should not fail.

Reproduction URL

/

How to reproduce?

  1. Create a new project
  2. Add cordova-ios
  3. Build it

Flavour

Quasar CLI with Webpack (@quasar/cli | @quasar/app-webpack)

Areas

Quasar CLI Commands/Configuration (@quasar/cli | @quasar/app-webpack | @quasar/app-vite), Cordova Mode

Platforms/Browsers

iOS

Quasar info output

Operating System - Darwin(23.4.0) - darwin/arm64
NodeJs - 18.20.2

Global packages
  NPM - 10.5.0
  yarn - 1.22.22
  @quasar/cli - 1.4.0
  @quasar/icongenie - Not installed
  cordova - 12.0.0 (cordova-lib@12.0.1)

Important local packages
  quasar - 2.15.4 -- Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time
  @quasar/app-webpack - 3.12.6 -- Quasar Framework App CLI with Webpack
  @quasar/extras - 1.16.11 -- Quasar Framework fonts, icons and animations
  eslint-plugin-quasar - Not installed
  vue - 3.2.39 -- The progressive JavaScript framework for building modern web UI.
  vue-router - 4.1.5
  pinia - Not installed
  vuex - Not installed
  electron - Not installed
  electron-packager - Not installed
  @electron/packager - Not installed
  electron-builder - Not installed
  @babel/core - 7.24.4 -- Babel compiler core.
  webpack - 5.91.0 -- Packs ECMAScript/CommonJs/AMD modules for the browser. Allows you to split your codebase into multiple bundles, which can be loaded on demand. Supports loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.
  webpack-dev-server - 4.11.1 -- Serves a webpack app. Updates the browser on changes.
  workbox-webpack-plugin - Not installed
  register-service-worker - 1.7.2 -- Script for registering service worker, with hooks
  typescript - 4.9.4 -- TypeScript is a language for application scale JavaScript development
  @capacitor/core - Not installed
  @capacitor/cli - Not installed
  @capacitor/android - Not installed
  @capacitor/ios - Not installed

Quasar App Extensions
  *None installed*

Relevant log output

** BUILD SUCCEEDED **

Error: ENOENT: no such file or directory, lstat '/Users/user/Desktop/app_mobile/src-cordova/platforms/ios/build/emulator'
    at Object.lstatSync (node:fs:1666:3)
    at Object.lstatSync (/Users/user/Desktop/app_mobile/node_modules/graceful-fs/polyfills.js:318:34)
    at statFunc (/Users/user/Desktop/app_mobile/node_modules/fs-extra/lib/util/stat.js:24:20)
    at getStatsSync (/Users/user/Desktop/app_mobile/node_modules/fs-extra/lib/util/stat.js:25:19)
    at Object.checkPathsSync (/Users/user/Desktop/app_mobile/node_modules/fs-extra/lib/util/stat.js:64:33)
    at Object.copySync (/Users/user/Desktop/app_mobile/node_modules/fs-extra/lib/copy/copy-sync.js:27:38)
    at CordovaRunner.build (/Users/user/Desktop/app_mobile/node_modules/@quasar/app-webpack/lib/cordova/index.js:101:9)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  errno: -2,
  syscall: 'lstat',
  code: 'ENOENT',
  path: '/Users/user/Desktop/app_mobile/src-cordova/platforms/ios/build/emulator'
}

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Additional context

Normally there's no error printed in the log - had to manually catch the webpack() promise exception inside build.js and output it.

w0pp commented 1 week ago

By the way @rstoenescu is there a reason why Quasar assumes you're building for an emulator, not a device? AFAIK Cordova also supports building for a device with the --device Cordova CLI option.

rstoenescu commented 1 week ago

I'll take care of everything. In the mean time, one can always directly use the IDE to build. Call the quasar build cmd with "--ide" argv (it will open the IDE where you can build & extract the distributable yourself)

rstoenescu commented 1 week ago

In fact, it's already built, it just fails at the very last step of copying files to /dist.

rstoenescu commented 1 week ago

Fix will be available in q/app-vite 1.8.4 & 2.0.0-beta.10 and q/app-webpack 3.12.7 & 4.0.0-beta.11

rstoenescu commented 1 week ago

And released all of them.

w0pp commented 1 week ago

Thanks for the quick response! Though I'm not sure why you added --device to the Cordova CLI options. Doesn't that essentially make it impossible to build for simulators? Besides, the build doesn't always output to platforms/ios/build/Release-iphoneos - it can also output to any of these paths:

rstoenescu commented 1 week ago

@w0pp Impossible is a strong word. You can always use the IDE to build directly (--ide param), or skip the build process entirely (--skip-pkg) and manually run any command (or run a script from quasar.config > build > afterBuild).

Added the "--device" param because this is something that can easily be missed (for some reason Cordova choses to build for the simulator by default) by unexperienced developers. However, please take a look at https://github.com/quasarframework/quasar/commit/8a4034c53dcf7b1363e44dfcfcabe96d5059524d and comment if you feel the need. I think this will nail it for whatever use cases there are out there, even for future cordova-ios/android versions (until we can pick it up and add native support).