phoenixframework / phoenix_live_reload

Provides live-reload functionality for Phoenix
MIT License
315 stars 90 forks source link

Reloading CSS causes exponential memory usage #23

Closed manveru closed 9 years ago

manveru commented 9 years ago

There seems to be a bug in the live reloading, here's my <head> after saving a CSS file 5 times (without making any changes).

2015-09-17 16_35_54

josevalim commented 9 years ago

Thank you! Is it because we need to remove the old stylesheet around here? https://github.com/phoenixframework/phoenix_live_reload/blob/master/priv/static/phoenix_live_reload.js#L1

manveru commented 9 years ago

well, link.remove() is supposed to do that. but it seems like this function is appending two new <link> tags for every previous tag.

chrismccord commented 9 years ago

I"m trying to recreate without much luck atm

chrismccord commented 9 years ago

can you include the entire head of your layout here?

manveru commented 9 years ago

I suspect it's a combination of a big CSS files and the server being remote, so it could be a race condition?

manveru commented 9 years ago

I can give you access to the server if you want, will PM you via slack.

Gazler commented 9 years ago

We fixed this over IRC - but for future readers, if you are using vim then the following will fix it:

set backupcopy=yes

To fix it permanently put that in your vimrc file.

chrismccord commented 9 years ago

@manveru fixed on master. Please set vim back to whatever write mode it was doing and verify the fix, then I'll push a new release. Thanks!

manveru commented 9 years ago

I couldn't reproduce the bug anymore, so consider it fixed. Thanks for the help!

chrismccord commented 9 years ago

1.0.1 has been released, mix deps.update phoenix_live_reload and you are all set!