Quasar + Vagrant



  • Hi, I was able to run quasar app in my vagrant but the hot reload is not working? Can you please advise?

    Vagrant:
    admin.sample.local

    When I run “quasar dev”, I use the link “admin.sample.local:3000” in my browser and it loads fine. However, when I modified some vue files, the hot reload is not working, I need to re-run again the “quarsar dev” for it to take effect in the browser.

    Thanks 🙂



  • have you searched online for a solution?
    -> http://tommylee.co/tutorials/fixing-hot-reload-vagrant.html

    you might also have to customize the webpack config to specify the new host, but dont know for sure



  • Change to Docker. It’s so much better.

    Scott



  • @Max it does not fix the issue. I am also seeing this in the console log:

    [HMR] Waiting for update signal from WDS…



  • In the quasar.conf.js file, you need to add watchOptions in devServer to make hotreload work properly:

        // Full list of options: https://quasar.dev/quasar-cli/quasar-conf-js#Property%3A-devServer
        devServer: {
          https: false,
          port: 8080,
          open: false, // we cannot open browser window on headless vagrant
          watchOptions: {
            aggregateTimeout: 100,
            poll: 1000
          }
        },
    

    You can play around with aggregateTimeout and poll but if you set them too low then the browser will just constantly refresh.



  • @josephd where did you find that info? There’s nothing in the Quasar docs about that.





  • @dobbel Long story actually… I actually got this solution from a Slack group when trying to get Laravel Mix (which is a webpack wrapper) working on vagrant. So I knew which setting were needed and just used good old trial-and-error pasting them all over the place in quasar.conf.js until it worked 🙂

    @qyloxe is right though, it’s actually detailed in the webpack docs and I guess it’s pretty much the same solution for a variety of different systems that use webpack in one way or another.



  • i agree with @s-molinari . I use Lando to develop in Docker. I can really recommend it.



  • And now that WSL2 is out, there are no reasons left to stick with Vagrant on Windows 10. 🙂

    Scott



  • @s-molinari said in Quasar + Vagrant:

    And now that WSL2 is out, there are no reasons left to stick with Vagrant on Windows 10. 🙂

    oh, good days of Vagrant, I remember running 38 vms with three separate networks, dmz, bunch of software server clusters (db, web, app, queue, mail, search etc.). And all of that on a single developer machine. It felt like a magic 🙂 Till the deployment, which was hell mixed with nightmare.

    Now everything is just simpler, and with Quasar clean architecture most of those ancient tasks are non-existent. Build, deploy, sync configuration, voila.


Log in to reply