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

fix: fix hot-reload not working after options get modified #77

Merged
merged 2 commits into from Sep 11, 2019

Conversation

liximomo
Copy link
Member

@liximomo liximomo commented Sep 9, 2019

Steps to reproduce:

  1. clone this repo, start it in development mode.
  2. change data msg in src/app.vue, hot reload works fine.
  3. activate Vue Devtools panel in Chrome Devtools.
  4. change data msg in src/app.vue, hot reload works fine.
  5. change data msg in src/app.vue again, hot reload stop working.

What happened here?
Vue Devtools will patch the existed component options when it gets activated, which caused this line to be run. As a result, record.options._Ctor is now pointing to newCtor.options._Ctor, which breaks the connection between record.Ctor and record.options and cause hot-reload failure.

src/index.js Outdated Show resolved Hide resolved
@sodatea
Copy link
Member

sodatea commented Sep 10, 2019

This change looks good to me.
Amazing job on spotting such a hard-to-locate issue 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants