quasarframework / quasar

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

Build production not terminate process (vite-plugin-checker issue) #17528

Closed Zeph33 closed 4 weeks ago

Zeph33 commented 1 month ago

What happened?

Build production with

quasar build

All files are build, ok, display banner

 Tip: Built files are meant to be served over an HTTP server
      Opening index.html over file:// won't work

 Tip: You can use "$ quasar serve" command to create a web server,
      both for testing or production. Type "$ quasar serve -h" for
      parameters. Also, an npm script (usually named "start") can
      be added for deployment environments.
      If you're using Vue Router "history" mode, don't forget to
      specify the "--history" parameter: "$ quasar serve --history"

process no exit, wait ....

What did you expect to happen?

Need to add process.exit(0) at end of then of appBuilder.build() in app-vite/lib/cmd/build.js

appBuilder.build()
  .catch(err => {
    console.error(err)
    fatal('App build failed (check the log above)', 'FAIL')
  })
  .then(async signal => {
....
    process.exit(0)
  })

Reproduction URL

I could not isolate the problem

How to reproduce?

I could not isolate the problem

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

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

Platforms/Browsers

No response

Quasar info output

Operating System - Linux(6.10.6-10-MANJARO) - linux/x64
NodeJs - 20.17.0

Global packages
  NPM - 10.8.2
  yarn - 1.22.22
  pnpm - Not installed
  bun - Not installed
  @quasar/cli - 2.4.1
  @quasar/icongenie - 4.0.0
  cordova - Not installed

Important local packages
  quasar - 2.17.0 -- Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time
  @quasar/app-vite - 2.0.0-beta.22 -- Quasar Framework App CLI with Vite
  @quasar/extras - 1.16.12 -- Quasar Framework fonts, icons and animations
  eslint-plugin-quasar - 1.1.0 -- Official ESLint plugin for Quasar
  vue - 3.5.6 -- The progressive JavaScript framework for building modern web UI.
  vue-router - 4.4.5
  pinia - 2.2.2 -- Intuitive, type safe and flexible Store for Vue
  vuex - Not installed
  vite - 5.4.6 -- Native-ESM powered web dev build tool
  vite-plugin-checker - Not installed
  eslint - 8.57.0 -- An AST-based pattern checker for JavaScript.
  esbuild - 0.23.1 -- An extremely fast JavaScript and CSS bundler and minifier.
  typescript - 5.6.2 -- TypeScript is a language for application scale JavaScript development
  workbox-build - Not installed
  register-service-worker - Not installed
  electron - Not installed
  @electron/packager - Not installed
  electron-builder - Not installed
  @capacitor/core - Not installed
  @capacitor/cli - Not installed
  @capacitor/android - Not installed
  @capacitor/ios - Not installed

Quasar App Extensions
  *None installed*

Networking
  Host - XXXXXX
  wlp2s0 - 192.168.2.2

Relevant log output

No response

Additional context

No response

github-actions[bot] commented 1 month ago

Hi @Zeph33! πŸ‘‹

It looks like you provided an invalid or unsupported reproduction URL. Do not use any service other than Codepen, jsFiddle, StackBlitz, Codesandbox, and GitHub. Make sure the URL you provided is correct and reachable. You can test it by visiting it in a private tab, another device, etc. Please edit your original post above and provide a valid reproduction URL as explained.

Without a proper reproduction, your issue will have to get closed.

Thank you for your collaboration. πŸ‘

Smrtnyk commented 1 month ago

Same here I noticed this in github actions where my build was still going on even after 6 hours so I had to terminate it and dowgrade to 21 https://github.com/Smrtnyk/Firetable/actions/runs/10960952434

Zeph33 commented 1 month ago

Same here I noticed this in github actions where my build was still going on even after 6 hours so I had to terminate it and dowgrade to 21 https://github.com/Smrtnyk/Firetable/actions/runs/10960952434

Yes, downgrade to 21, or apply patch to 22 to add process.exit(0)

Zeph33 commented 1 month ago

Build ok with esbuild 0.23.0, hang with 0.23.1 Fix in package.json, add

  "overrides": {
    "esbuild": "0.23.0"
  }
JamieMcDonnell commented 1 month ago

Adding:

 "overrides": {
    "esbuild": "0.23.0"
  }

to package.json was not enough for me - I had to modify yarn.lock manually and replace 0.23.1 > 0.23.0 everywhere in the following:


esbuild@^0.23.0:
  version "0.23.0"
  resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.23.1.tgz#40fdc3f9265ec0beae6f59824ade1bd3d3d2dab8"
  integrity sha512-VVNz/9Sa0bs5SELtn3f7qhJCDPCF5oMEl5cO9/SSinpE9hbPVvxbd572HH5AKiP7WD8INO53GgfDDhRjkylHEg==
  optionalDependencies:
    "@esbuild/aix-ppc64" "0.23.0"
    "@esbuild/android-arm" "0.23.0"
    "@esbuild/android-arm64" "0.23.0"
    "@esbuild/android-x64" "0.23.0"
    "@esbuild/darwin-arm64" "0.23.0"
    "@esbuild/darwin-x64" "0.23.0"
    "@esbuild/freebsd-arm64" "0.23.0"
    "@esbuild/freebsd-x64" "0.23.0"
    "@esbuild/linux-arm" "0.23.0"
    "@esbuild/linux-arm64" "0.23.0"
    "@esbuild/linux-ia32" "0.23.0"
    "@esbuild/linux-loong64" "0.23.0"
    "@esbuild/linux-mips64el" "0.23.0"
    "@esbuild/linux-ppc64" "0.23.0"
    "@esbuild/linux-riscv64" "0.23.0"
    "@esbuild/linux-s390x" "0.23.0"
    "@esbuild/linux-x64" "0.23.0"
    "@esbuild/netbsd-x64" "0.23.0"
    "@esbuild/openbsd-arm64" "0.23.0"
    "@esbuild/openbsd-x64" "0.23.0"
    "@esbuild/sunos-x64" "0.23.0"
    "@esbuild/win32-arm64" "0.23.0"
    "@esbuild/win32-ia32" "0.23.0"
    "@esbuild/win32-x64" "0.23.0"
Build now terminates properly again.
yusufkandemir commented 1 month ago

@JamieMcDonnell yarn v1 uses the resolutions field. So, you can rename overrides to resolutions, then run yarn.

QuentinLavieville commented 1 month ago

In my case, i had to delete package-lock.json file in order to update the esbuild version. But the overrides method fixed the issue for me too.

yusufkandemir commented 1 month ago

esbuild 0.24.0 seems to be working. Can you people try it out and let me know, please? If it's working, we will upgrade esbuild and make a new release.

QuentinLavieville commented 1 month ago

esbuild 0.24.0 seems to be working. Can you people try it out and let me know, please? If it's working, we will upgrade esbuild and make a new release.

I can confirm version 0.24.0 is working fine both in CI and in command line build.

amdest commented 1 month ago

esbuild 0.24.0 seems to be working. Can you people try it out and let me know, please? If it's working, we will upgrade esbuild and make a new release.

Seems to work as expected: build process gets finished with exit code 0.

Screenshot 2024-09-25 at 11 54 54
Zeph33 commented 1 month ago

esbuild 0.24.0 seems to be working. Can you people try it out and let me know, please? If it's working, we will upgrade esbuild and make a new release.

build completes successfully with version 0.24.0

Zeph33 commented 1 month ago

esbuild 0.24.0 seems to be working. Can you people try it out and let me know, please? If it's working, we will upgrade esbuild and make a new release.

Doesn't end all the time. I apply the patch on app-vite by adding process.exit(0)

rstoenescu commented 4 weeks ago

Esbuild 0.24+ will be used in:

rstoenescu commented 4 weeks ago

Something is still wrong. I can reproduce with esbuild 0.24 too, but not with all projects. I have only one that doesn't exits after building.

I've investigated a bit and it's not esbuild at fault, but vite-plugin-checker. Once I don't use it the build exits.

Please can someone report this to vite-plugin-checker team? Thank you.

amdest commented 4 weeks ago

Four projects where "vite-plugin-checker: ^0.8.0" are building normally every time when using esbuild = 0.24.0 (SPA + Electron) and all of them get stalled with esbuild = 0.23.

rstoenescu commented 4 weeks ago

Well, like I said. For me, it's only one project that doesn't exits, no matter the esbuild version. Once I remove vite-plugin-checker (v0.7 or v0.8), it exits again.

Installing the q/app versions from above will force esbuild 0.24+, so in your case it should work. But there is still the problem with vite-plugin-checker. Also, we cannot force exit the node process, otherwise we will get into trouble with other issues. One example: https://github.com/quasarframework/quasar/issues/17420

jacobfrantz1 commented 1 week ago

I had a very similar issue that led me here, but with a different cause I'd like to document for anybody else searching for this issue.

There is another build hang that occurs when using vite 5 < 5.4.8 and node 22 related to sass compiling. After upgrading vite to 5.4.8 the hang goes away.