vitejs / vite-plugin-vue

Vite Vue Plugins
MIT License
455 stars 140 forks source link

HMR infinite loop inside `deepEqual` #400

Open aguingand opened 2 months ago

aguingand commented 2 months ago

Related plugins

Describe the bug

I can reproduce an infinite loop during HMR. I have located the loop inside deepEqual function introduced in (#258 and #334). It seems to appear when importing third-party library (here radix-vue / vue) because it recursively walk through the AST of the library components / TS definitions (non-project file).

Related issue #350.

Reproduction

https://stackblitz.com/edit/vite-plugin-vue-hmr-inifite-loop-repro

Steps to reproduce

System Info

System:
    OS: macOS 12.7.4
    CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
    Memory: 1.88 GB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node
    npm: 10.7.0 - ~/.nvm/versions/node/v20.12.2/bin/npm
    pnpm: 8.15.8 - ~/.nvm/versions/node/v20.12.2/bin/pnpm
  npmPackages:
    @vitejs/plugin-vue: ^5.0.4 => 5.0.4
    vite: ^5.2.11 => 5.2.11

Used Package Manager

npm

Logs

No response

Validations

aguingand commented 2 months ago

I've updated system infos, it occurs in latest version (5.0.4). Version 4.6.2 is not affected.

elliots commented 2 months ago

I'm seeing this in our project too image

sxzz commented 2 months ago

/cc @sodatea