quasar icon indicating copy to clipboard operation
quasar copied to clipboard

Hot reloading issue

Open tianhuat opened this issue 2 years ago • 19 comments

Hi I am using Quasar CLI with latest Quasar downloaded yesterday in Windows 10. I have some issues with hot reloading highlighted here: https://www.loom.com/share/3137f7ac86974af78a222a207b7c375e, what is the problem?

tianhuat avatar Nov 04 '21 07:11 tianhuat

There has been a few discussions about a hot reloading issues in the past few weeks: https://github.com/quasarframework/quasar/discussions?discussions_q=hot+reload

Check it out to see if you could find a workaround there.

MilosPaunovic avatar Nov 04 '21 08:11 MilosPaunovic

@tianhuat If you are using the Class API, then it's been recently fixed (today): https://github.com/vuejs/vue-loader/pull/1897

We will have our own release soon.

hawkeye64 avatar Nov 04 '21 14:11 hawkeye64

This seems to be something different, for TS + Options API.

rstoenescu avatar Nov 04 '21 18:11 rstoenescu

@rstoenescu He is using q/app v3.1.8 in the video. The HMR fix is in q/app v3.1.9...

hawkeye64 avatar Nov 05 '21 19:11 hawkeye64

His issue has nothing to do with the fix for TS + vue-class-component. He is not using the Class API. @hawkeye64

rstoenescu avatar Nov 05 '21 21:11 rstoenescu

I am facing same issues occasionally with HMR not working when changing something in template using ts + script setup It happens when I change color of the q-btn for example, the changes are not reflected, I need to manually reload

Smrtnyk avatar Nov 06 '21 19:11 Smrtnyk

I don't know if it's related or if it can help but I'm facing the same issue as @Smrtnyk but with vite and script setup on q-btn props.

EDIT Versions used:

  "dependencies": {
    "@quasar/extras": "^1.11.5",
    "@vueuse/core": "^6.8.0",
    "pinia": "^2.0.2",
    "vue": "^3.2.16",
    "vue-router": "4"
  },
  "devDependencies": {
    "@quasar/vite-plugin": "^1.0.2",
    "@vitejs/plugin-vue": "^1.9.4",
    "quasar": "^2.3.0",
    "sass": "1.43.4",
    "unplugin-vue-components": "^0.17.2",
    "vite": "^2.6.13"
  }

J3m5 avatar Nov 10 '21 10:11 J3m5

I am facing the same problem shown in the video (HMR not working when adding props/attributes to elements). I am using TS with composition API without script setup, with @quasar/app v3.1.10.

sullyD64 avatar Nov 10 '21 11:11 sullyD64

Hi @hawkeye64 @rstoenescu, I have updated to @quasar/app v3.1.10, the above problem seems to be resolved, but I faced another hot reloading problem: https://www.loom.com/share/4afe701837a4481b9120d83f49a9d0ee

I attached the code here for your testing convenient:

<template>
  <q-layout view="lHh Lpr lFf">
    <q-header elevated>
      <q-toolbar>
        <q-input dense rounded outlined v-model="text" label="eer" />
      </q-toolbar>
    </q-header>
  </q-layout>
</template>

tianhuat avatar Nov 14 '21 06:11 tianhuat

Vue has fixed some stuff regarding hmr in latest release https://github.com/vuejs/vue-next/blob/master/CHANGELOG.md not sure if it is something that relates to issues we have mentioned here

Smrtnyk avatar Nov 26 '21 08:11 Smrtnyk

I have updated the dependencies and it seems to be fixed now.

J3m5 avatar Nov 26 '21 08:11 J3m5

Hi, how do we upgrade to the latest vue version and test in the existing Quasar project?

tianhuat avatar Nov 26 '21 10:11 tianhuat

if you are using quasar cli you don't, you wait for quasar to upgrade you can add the dependency manually to your package.json but I wouldn't go using that route

Smrtnyk avatar Nov 26 '21 16:11 Smrtnyk

@quasar/app should be updated/released this weekend The HMR updates are related to <script setup lang="ts">

hawkeye64 avatar Nov 26 '21 21:11 hawkeye64

I do still face this problem. both with or without the "setup" in the script tag

I started a new quasar project using the CLI - Quasar 2 Vue 3 with Typescript and Vite When I add a q-input with a v-model to a ref() it works, but Hot Reload is not working anymore for the q-input field.

zookz avatar May 25 '22 11:05 zookz

I can confirm this problem in some of the local projects, I created some repros in StackBlitz to showcase the problems. The repros use Quasar CLI with Vite without TypeScript, but the problem also exists when using TypeScript.

  • <script setup>: https://stackblitz.com/edit/quasar-vite-weird-hmr-behavior?file=src%2Fpages%2FIndexPage.vue

  • <script>: https://stackblitz.com/edit/quasar-vite-weird-hmr-behavior-without-script-setup?file=src%2Fpages%2FIndexPage.vue

    • Second test case from <script setup> stops working when using regular <script>

yusufkandemir avatar May 26 '22 19:05 yusufkandemir

i am having similar issue, i an using script setup + vite + js , my issue is only in composable , the hot reload is not working in composable file changes rest child parent components working fine

my structure of app layout>loginPage>loginComponent the login component and login page both uses the loginComposable < here changes are not reflecting

geminigeek avatar Jun 06 '22 07:06 geminigeek

I believe this is a known issue with Vite, but don't have the capacity to find the issue # right now.

hawkeye64 avatar Jun 08 '22 17:06 hawkeye64

Might be related: https://github.com/vitejs/vite/issues/8224, https://github.com/vitejs/vite/issues/7839

yusufkandemir avatar Jun 08 '22 17:06 yusufkandemir

Problem still persists. Changing color on q-btn doesn't get reflected, however changing color on a q-badge does.

App Setup Info

Operating System - Darwin(22.2.0) - darwin/x64 NodeJs - 16.14.2

Global packages NPM - 8.5.0 @quasar/cli - 2.0.0 @quasar/icongenie - 2.5.1

Important local packages quasar - 2.7.1 -- Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time @quasar/app-webpack - 3.7.1 -- Quasar Framework App CLI with Webpack @quasar/extras - 1.14.0 -- Quasar Framework fonts, icons and animations

vue - 3.2.31 -- The progressive JavaScript framework for building modern web UI. vue-router - 4.0.15

vuex - 4.0.2 -- state management for Vue.js @babel/core - 7.14.6 -- Babel compiler core. webpack - 5.59.1 -- Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support 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 - 3.4.3 -- Capacitor: Cross-platform apps with JavaScript and the web @capacitor/cli - 3.4.3 -- Capacitor: Cross-platform apps with JavaScript and the web @capacitor/ios - 3.4.3 -- Capacitor: Cross-platform apps with JavaScript and the web`

AleksKamb avatar Mar 21 '23 13:03 AleksKamb

This might fix the problem when vue 3.3 is out: https://github.com/vuejs/core/commit/4b5b384485cf8f6124f6738b89e3d047358f3a11 https://github.com/vuejs/core/commit/94fa67a4f73b3646c8c1e29512a71b17bd56efc3

J3m5 avatar Apr 20 '23 10:04 J3m5

Since we moved to using the script setup syntax we are also experiencing this problem. Whenever I write a new component I have to manually restart the dev server. Component changes also require a restart sometimes. We are using Quasar 2.12.0 with Vue 3.3.4 and WebPack

Walnussbaer avatar Jul 21 '23 08:07 Walnussbaer

Just found out, i forgot to change component path in route file. Before this i rename the folder of component. Now it fixed and working fine.

muhdammar avatar Sep 10 '23 04:09 muhdammar

I'm also facing the same problem, I'm trying to update classes in the css, the browser identifies the change by sending a console.log() but it doesn't update the component on the screen.

Quasar info:

Operating System - Darwin(23.3.0) - darwin/arm64 NodeJs - 21.2.0

Global packages NPM - 10.2.3 yarn - 1.22.19 @quasar/cli - 2.4.0 @quasar/icongenie - 2.5.4 cordova - Not installed

Important local packages quasar - 2.15.0 -- Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time @quasar/app-vite - 1.8.0 -- Quasar Framework App CLI with Vite @quasar/extras - 1.16.9 -- Quasar Framework fonts, icons and animations eslint-plugin-quasar - Not installed vue - 3.4.21 -- The progressive JavaScript framework for building modern web UI. vue-router - 4.3.0 pinia - 2.1.7 -- Intuitive, type safe and flexible Store for Vue vuex - Not installed vite - 2.9.15 -- Native-ESM powered web dev build tool eslint - 8.41.0 -- An AST-based pattern checker for JavaScript. electron - Not installed electron-packager - Not installed electron-builder - Not installed register-service-worker - Not installed @capacitor/core - Not installed @capacitor/cli - Not installed @capacitor/android - Not installed @capacitor/ios - Not installed

Captura de Tela 2024-03-28 às 18 05 22 Captura de Tela 2024-03-28 às 18 05 36

patrickmonteiro avatar Mar 28 '24 22:03 patrickmonteiro

Somehow I managed to solve it by updating the quasar packages and also updating other packages in my project with yarn outdated command. 🚀

NodeJs - 21.2.0

Global packages
  NPM - 10.2.3
  yarn - 1.22.19
  @quasar/cli - 2.4.0
  @quasar/icongenie - 2.5.4
  cordova - Not installed

Important local packages
  quasar - 2.15.1 -- Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time
  @quasar/app-vite - 1.8.0 -- Quasar Framework App CLI with Vite
  @quasar/extras - 1.16.10 -- Quasar Framework fonts, icons and animations
  eslint-plugin-quasar - Not installed
  vue - 3.4.21 -- The progressive JavaScript framework for building modern web UI.
  vue-router - 4.3.0
  pinia - 2.1.7 -- Intuitive, type safe and flexible Store for Vue
  vuex - Not installed
  vite - 2.9.15 -- Native-ESM powered web dev build tool
  eslint - 8.41.0 -- An AST-based pattern checker for JavaScript.
  electron - Not installed
  electron-packager - Not installed
  electron-builder - Not installed
  register-service-worker - Not installed
  @capacitor/core - Not installed
  @capacitor/cli - Not installed
  @capacitor/android - Not installed
  @capacitor/ios - Not installed

Quasar App Extensions
  *None installed*

patrickmonteiro avatar Apr 01 '24 00:04 patrickmonteiro