Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quasar build fails with latest cordova-ios #17138

Closed
w0pp opened this issue Apr 25, 2024 · 13 comments
Closed

Quasar build fails with latest cordova-ios #17138

w0pp opened this issue Apr 25, 2024 · 13 comments
Assignees

Comments

@w0pp
Copy link

w0pp commented Apr 25, 2024

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 w0pp added kind/bug 🐞 Qv2 🔝 Quasar v2 issues labels Apr 25, 2024
@github-actions github-actions bot added area/cli bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-webpack mode/cordova labels Apr 25, 2024
@rstoenescu rstoenescu self-assigned this Apr 25, 2024
@w0pp
Copy link
Author

w0pp commented Apr 25, 2024

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
Copy link
Member

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
Copy link
Member

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

@rstoenescu
Copy link
Member

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
Copy link
Member

And released all of them.

@w0pp
Copy link
Author

w0pp commented Apr 26, 2024

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:

  • platforms/ios/build/Release-iphonesimulator
  • platforms/ios/build/Debug-iphoneos
  • platforms/ios/build/Debug-iphonesimulator

rstoenescu added a commit that referenced this issue Apr 26, 2024
…cordova (getCordovaBuildParams & getCordovaBuildOutputFolder) #17138
@rstoenescu
Copy link
Member

@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 8a4034c 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).

rstoenescu added a commit that referenced this issue Apr 26, 2024
…ns for quasar.config file > cordova (getCordovaBuildParams & getCordovaBuildOutputFolder) #17138
@w0pp
Copy link
Author

w0pp commented May 6, 2024

@rstoenescu
The commit looks good to me, however the build seems to fail without any error after upgrading @quasar/app-webpack from 3.12.7 to 3.12.8 and running quasar build -m ios.
The last thing the console outputs is App • ⚠️ Build succeeded, but with 3 warnings. Check log above.

@rstoenescu
Copy link
Member

What are the warnings?

@w0pp
Copy link
Author

w0pp commented May 6, 2024

What are the warnings?

Just some "couldn't fulfill desired order of chunk group(s)" CSS warnings, but they're the same ones I get with 3.12.7, so I don't think they have anything to do with the build failing.

@rstoenescu
Copy link
Member

@w0pp would you be so kind to show me the full output, pls?

@rstoenescu
Copy link
Member

@w0pp nevermind. reproduced the issue.

@rstoenescu
Copy link
Member

@w0pp thanks for reporting this latter issue also! Fix will be available in q/app-webpack v3.13. Out of all the 4 versions of q/app-*, this one was the only one with a bug in the implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants