Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HMR crash on attribute change #1156

Closed
damianstasik opened this issue May 10, 2020 · 1 comment
Closed

HMR crash on attribute change #1156

damianstasik opened this issue May 10, 2020 · 1 comment
Labels
🐞 bug Something isn't working scope: hmr

Comments

@damianstasik
Copy link

Describe the bug

In a freshly created app created using create-vite-app I stumbled upon a weird bug that is triggered when you update the state (for example by clicking on the increase button) and then add/remove/change attributes of any native HTML element that listens to any event. This should trigger one of two possible errors:

  1. TypeError: "el is null" if style or class attributes are changed.
  2. TypeError: "right-hand side of 'in' should be an object, got null" if any other attributes are changed.

System Info

  • required vite version: 0.13.2
  • required Operating System: MacOS 10.15.4
  • required Node version: 12.16.1
  • Optional:
    • npm/yarn version: 6.13.4/1.22.4
    • Installed vue version (from yarn.lock or package-lock.json): 3.0.0-beta.10
    • Installed @vue/compiler-sfc version: 3.0.0-beta.10

Logs

  vite:server server ready in 170ms. +0ms
  vite:history redirecting / to /index.html +0ms
  vite:hmr serving hmr client +0ms
  vite:resolve (vue) vue -> node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js +0ms
  vite:sfc /Users/damian/Desktop/vite-app/App.vue parsed in 8ms. +0ms
  vite:rewrite /App.vue: rewriting +0ms
  vite:rewrite     "./Comp.vue" --> "/Comp.vue" +1ms
  vite:hmr         /App.vue imports /Comp.vue +18ms
  vite:rewrite     "vue" --> "/@modules/vue" +1ms
  vite:hmr         /App.vue imports /@modules/vue +0ms
  vite:rewrite     "vite/hmr" --> "/vite/hmr" +0ms
  vite:rewrite /@modules/vue: rewriting +3ms
  vite:rewrite     "@vue/runtime-core" --> "/@modules/@vue/runtime-core" +1ms
  vite:hmr         /@modules/vue imports /@modules/@vue/runtime-core +4ms
  vite:rewrite     "@vue/runtime-core" --> "/@modules/@vue/runtime-core" +0ms
  vite:hmr         /@modules/vue imports /@modules/@vue/runtime-core +0ms
  vite:rewrite     "@vue/shared" --> "/@modules/@vue/shared" +0ms
  vite:hmr         /@modules/vue imports /@modules/@vue/shared +0ms
  vite:sfc /Users/damian/Desktop/vite-app/App.vue parse cache hit +28ms
  vite:sfc /App.vue template compiled in 15ms. +15ms
  vite:rewrite (skipped) /App.vue?type=template +35ms
  vite:resolve (vue) @vue/shared -> node_modules/@vue/shared/dist/shared.esm-bundler.js +54ms
  vite:resolve (vue) @vue/runtime-core -> node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js +1ms
  vite:sfc /Users/damian/Desktop/vite-app/Comp.vue parsed in 1ms. +2ms
  vite:rewrite /@modules/@vue/shared: no imports found. +4ms
  vite:rewrite /@modules/@vue/runtime-core: rewriting +3ms
  vite:rewrite     "@vue/reactivity" --> "/@modules/@vue/reactivity" +4ms
  vite:hmr         /@modules/@vue/runtime-core imports /@modules/@vue/reactivity +46ms
  vite:rewrite     "@vue/reactivity" --> "/@modules/@vue/reactivity" +0ms
  vite:hmr         /@modules/@vue/runtime-core imports /@modules/@vue/reactivity +0ms
  vite:rewrite     "@vue/shared" --> "/@modules/@vue/shared" +0ms
  vite:hmr         /@modules/@vue/runtime-core imports /@modules/@vue/shared +0ms
  vite:sfc /Users/damian/Desktop/vite-app/Comp.vue parse cache hit +10ms
  vite:sfc /Comp.vue template compiled in 1ms. +1ms
  vite:resolve (vue) @vue/reactivity -> node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js +26ms
  vite:rewrite /@modules/@vue/reactivity: rewriting +19ms
  vite:rewrite     "@vue/shared" --> "/@modules/@vue/shared" +0ms
  vite:hmr         /@modules/@vue/reactivity imports /@modules/@vue/shared +19ms
  vite:sfc /Users/damian/Desktop/vite-app/App.vue parse cache hit +26ms
  vite:sfc /App.vue style compiled in 34ms +34ms
  vite:hmr ws client connected +21s
  vite:hmr busting Vue cache for /Users/damian/Desktop/vite-app/App.vue +4s
  vite:rewrite /App.vue: cache busted +25s
  vite:sfc /Users/damian/Desktop/vite-app/App.vue parsed in 3ms. +25s
  vite:hmr update: {
  vite:hmr   "type": "vue-rerender",
  vite:hmr   "path": "/App.vue",
  vite:hmr   "timestamp": 1589114690075
  vite:hmr } +6ms
  vite:sfc /Users/damian/Desktop/vite-app/App.vue parse cache hit +6ms
  vite:sfc /App.vue template compiled in 6ms. +6ms
  vite:rewrite (skipped) /App.vue?type=template&t=1589114690075 +17ms

Reproduction

  1. Run create-vite-app cmd and start the app
  2. Click on the increase button
  3. Add/change/remove attribute of the same button you clicked
@vue-bot
Copy link
Contributor

vue-bot commented May 10, 2020

Hello, thank you for taking time filling this issue!

However, we kindly ask you to use our Issue Helper when creating new issues, in order to ensure every issue provides the necessary information for us to investigate. This explains why your issue has been automatically closed by me (your robot friend!).

I hope to see your helper-created issue very soon!

@yyx990803 yyx990803 transferred this issue from vitejs/vite May 10, 2020
@vue-bot vue-bot closed this as completed May 10, 2020
@yyx990803 yyx990803 added the 🐞 bug Something isn't working label May 10, 2020
@yyx990803 yyx990803 reopened this May 10, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Nov 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐞 bug Something isn't working scope: hmr
Projects
None yet
Development

No branches or pull requests

3 participants