Giter Site home page Giter Site logo

Comments (2)

TechAkayy avatar TechAkayy commented on September 28, 2024

After a lot of trial and error, I have figured out where the issue is:

Nuxt's HMR is getting blocked when, in the custom vite plugin's "config" hook, either the original config object (after mutating it) or a mergedConfig is returned. Vite docs seems to support this return in the config hook.

This HMR break is specific to Nuxt, as HMR is not blocked in a plain Vue project with the same custom vite plugin .

This breaks Nuxt's HMR (returns a merged config)

image

And after some very long timeout (couple of minutes), this gets logged

image

This doesn't break HMR (avoids mergeConfig and directly mutates the config)

image

I have updated my Vite plugin to directly mutate instead returning a config using mergeConfig vite utility. The above is just an example, I do make few other config updates, hence used mergeConfig.

Even though this is solved at my end, why Nuxt's HMR is blocked when using mergeConfig utility and returning a merged config is still a mystery, unless Im not supposed to do this way.

Maintainers, please feel free to close this if you see no action on this issue. Thanks for looking into this.

from cli.

TechAkayy avatar TechAkayy commented on September 28, 2024

Updated reproduction to latest (3.13.0) using npx nuxi upgrade --force, and removed vue & vue-router from package.json as they not required to be added explicitly anymore. HMR works nicely 😃 !

Issue doesn't seem to reoccur anymore. Thanks @pi0 @danielroe.

from cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.