question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HMR broken since 2.3.7

See original GitHub issue

Describe the bug

See UPDATE below.

I have pretty big project with nested components. Basically this is what happened: v2.3.6 --> HMR OK, everything is working fine v2.4.0-beta-0 --> HMR not correctly updating a child component (only CSS / tailwind changes, but it doesn’t react to html changes in my vue template, i.e: adding text does nothing) v2.4.0-beta-1 --> HMR is not working anymore when I edit the child component, I got only page reloads, every change triggers a page reload

So I think you introduced or changed something in v2.4.0-beta-0 that breaks HMR in certain circonstances. Then in v2.4.0-beta-1 it always triggers page reloads

Update

Ok, I just tested EVERY build, from 2.2.4 to 2.3.8. Removed yarn.lock and node_modules each time, then yarn install each time. 2.2.4: OK 2.3.5: OK 2.3.6: OK 2.3.7: HMR not working as expected (see below) 2.3.8 to 2.4.1 --> HMR not working as expected

You have introduced something in 2.3.7 that breaks HMR.

Reproduction

I cannot really reproduce because I’ve 1500+ components and I’m totally lost finding why the HMR fails.

But basically:

  • any change to my App.vue is working as expected (HMR working great)
  • any change to a page component dynamically loaded by vue-router is also working as expected (see below site.Home.vue, if I edit that page, HMR is working as expected)

But if that page contains a child component (something like /components/Avatar.vue), then it becomes a nightmare: even a simple change to that component triggers nothing (v2.3.7) or systematically triggers a page reload starting with v2.4.0-beta-1 (including v2.4.1)

–> Everything is working fine with vite v2.3.6 –> Since 2.3.7, HRM doesn’t update (but not page reload as well)

router.js

  ...
  {
    path: '/',
    meta: { layout: LayoutSite },
    component: loader(() => import('@/views/site/site.Home.vue'))
  },

I’m using a custom made loader to show a spinner (for code splitting)

loader.js

const loader = (fn) => {
  return () => {
    const timer = setTimeout(()=>{
      /* show Spinner */
    }, 50)
    
    const done = ()=>{
      clearTimeout(timer)
      /* hide Spinner */
      return
    }

    const promise = fn()
    promise.then(done, done)
    return promise
  }
}

export default loader

System Info


  System:
    OS: macOS 10.15.7
    CPU: (6) x64 Intel(R) Core(TM) i5-8500 CPU @ 3.00GHz
    Memory: 1.96 GB / 32.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 14.17.3 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 6.14.13 - /usr/local/bin/npm
  Browsers:
    Brave Browser: 89.1.22.71
    Chrome: 91.0.4472.114
    Firefox: 89.0.2
    Safari: 14.0.1
  npmPackages:
    @vitejs/plugin-vue: ^1.2.4 => 1.2.4 
    vite: 2.3.7 => 2.3.7 

Used Package Manager

yarn

Logs

No response

Validations

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:7
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
yyx990803commented, Aug 3, 2021

AFAIK already fixed post 2.3.8 in 6eaec3ab

0reactions
NickSdotcommented, Jul 17, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack-hot-middleware - npm.io
2.0.0. Breaking Change. As of version 2.0.0, all client functionality has been rolled into this module. This means that you should remove any...
Read more >
Changelog | Meteor API Docs
Fix issues with HMR and meteor build --debug PR. webapp@1.13.1 ... Patch to make 2.3.7 compatible with Push to Deploy feature in Galaxy...
Read more >
HMR56.pdf - National Weather Service
HMR No. 55, "Probable Maximum Precipitation Estimates, ... Since storms like the Smethport storm are such a rarity, we are forced to turn....
Read more >
ts-loader - npm
Inside your HMR acceptance callback function, maybe re-require the module that was replaced. Contributing. This is your TypeScript loader! We ...
Read more >
Compliance Manual
After the carriers identified as High-Risk are assigned, ... Hazardous Materials Regulations (HMR) that existed prior to or at the time of ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found