{"action":"created","issue":{"url":"https://api.github.com/repos/phoenixframework/phoenix_live_reload/issues/7","labels_url":"https://api.github.com/repos/phoenixframework/phoenix_live_reload/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/phoenixframework/phoenix_live_reload/issues/7/comments","events_url":"https://api.github.com/repos/phoenixframework/phoenix_live_reload/issues/7/events","html_url":"https://github.com/phoenixframework/phoenix_live_reload/issues/7","id":70592922,"number":7,"title":"Phoenix is locked in a loop when a file is reloaded on Windows","user":{"login":"kojoru","id":1836172,"avatar_url":"https://avatars.githubusercontent.com/u/1836172?v=3","gravatar_id":"","url":"https://api.github.com/users/kojoru","html_url":"https://github.com/kojoru","followers_url":"https://api.github.com/users/kojoru/followers","following_url":"https://api.github.com/users/kojoru/following{/other_user}","gists_url":"https://api.github.com/users/kojoru/gists{/gist_id}","starred_url":"https://api.github.com/users/kojoru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kojoru/subscriptions","organizations_url":"https://api.github.com/users/kojoru/orgs","repos_url":"https://api.github.com/users/kojoru/repos","events_url":"https://api.github.com/users/kojoru/events{/privacy}","received_events_url":"https://api.github.com/users/kojoru/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-24T05:37:01Z","updated_at":"2015-04-24T06:15:57Z","closed_at":null,"body":"Steps to reproduce:\r\n1. Install Phoenix as in tutorial on Windows\r\n2. Launch `mix phoenix.server`\r\n2. Open http://localhost:4000 in a web browser\r\n3. Change a template\r\n\r\nResult: a web page is reloaded indefinitely. \r\nExpected result: a web page is reloaded once \r\n\r\nI don't always see the behavior but I see it most of the time. The reason seems to be that template editing triggers the rebuild of files like `_build\\dev\\lib\\<projectname>\\priv\\static\\js` which match happily against the default regexp `priv/static/.*(js|css|png|jpeg|jpg|gif)$` which cause rebuild again.\r\n\r\nAs a result something as crude as setting `live_reload` config to \r\n```\r\npatterns: [\r\n      ~r{^.*(?!.*_build.*).*priv/static/.*(js|css|png|jpeg|jpg|gif)$},\r\n      ~r{^.*(?!.*_build.*).*web/views/.*(ex)$},\r\n      ~r{^.*(?!.*_build.*).*web/templates/.*(eex)$}\r\n    ]\r\n```\r\n\r\nworks. But that doesn't seem to be needed on other patforms. Why?"},"comment":{"url":"https://api.github.com/repos/phoenixframework/phoenix_live_reload/issues/comments/95814780","html_url":"https://github.com/phoenixframework/phoenix_live_reload/issues/7#issuecomment-95814780","issue_url":"https://api.github.com/repos/phoenixframework/phoenix_live_reload/issues/7","id":95814780,"user":{"login":"josevalim","id":9582,"avatar_url":"https://avatars.githubusercontent.com/u/9582?v=3","gravatar_id":"","url":"https://api.github.com/users/josevalim","html_url":"https://github.com/josevalim","followers_url":"https://api.github.com/users/josevalim/followers","following_url":"https://api.github.com/users/josevalim/following{/other_user}","gists_url":"https://api.github.com/users/josevalim/gists{/gist_id}","starred_url":"https://api.github.com/users/josevalim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josevalim/subscriptions","organizations_url":"https://api.github.com/users/josevalim/orgs","repos_url":"https://api.github.com/users/josevalim/repos","events_url":"https://api.github.com/users/josevalim/events{/privacy}","received_events_url":"https://api.github.com/users/josevalim/received_events","type":"User","site_admin":false},"created_at":"2015-04-24T06:15:57Z","updated_at":"2015-04-24T06:15:57Z","body":"Thank you! I completely missed it on the title. :) I know exactly why this\nhappens. On windows we can't symlink, so we copy files triggering the event\nmultiple times. Your work around is great, we should fix live reload though\nto just ignore everything from _build.\n\n-- \n\n\n*José Valimwww.plataformatec.com.br\n<http://www.plataformatec.com.br/>Founder and Lead Developer*\n"}}