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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parcel doesn't remove older elements after live reload. #2648

Closed
jnpco98 opened this issue Feb 16, 2019 · 1 comment
Closed

Parcel doesn't remove older elements after live reload. #2648

jnpco98 opened this issue Feb 16, 2019 · 1 comment
Labels
馃悰 Bug HMR Hot Module Reloading

Comments

@jnpco98
Copy link

jnpco98 commented Feb 16, 2019

馃悰 bug report

Whenever parcel does a live reload, old elements that are appended to the dom are not removed.

馃實 Your Environment

win10, vs_code

Software Version(s)
Parcel 1.11.0
Node v10.13.0
npm/Yarn 6.4.1
Operating System Windows 10

Code:
https://github.com/jnpco/d3_parcel

@mischnic
Copy link
Member

This is a result of how Parcel's HMR works. Something like #289 would be needed in this situation.
Otherwise, you could do this:

if(module.hot)
  module.hot.dispose(function() {
    // remove your old elements / clear container
  });

@mischnic mischnic added the HMR Hot Module Reloading label Feb 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
馃悰 Bug HMR Hot Module Reloading
Projects
None yet
Development

No branches or pull requests

3 participants