-
Notifications
You must be signed in to change notification settings - Fork 949
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
Upload tutorial file path triggers live reload for images #2253
Comments
This is a tricky one because the shortest path to serving the files that were uploaded is to put them into priv/static, so they can be picked up by the |
Ping @jsmestad any interest in sending PR to the guides? Thanks! |
@chrismccord definitely interested in contributing when I can find the time. Crunch time getting HeadsDown out the door 🔥 |
This is tricky because we want to add them to priv/static so we can render them :S |
Background
While trying to implement LiveView uploads I was pulling my hair out because the Plug.Upload file kept disappearing.
I could not figure out the cause until it hit me: the default live_reload config uses
priv/static/*.(png|jpg|....)
which is the same save location used by the Upload tutorial.What happens
Whenever the file is copied into the path this triggers a recompilation due to the live_reload pattern match and thus reaping the current process and the Plug.Upload path goes missing.
Suggested Change
Most folks are probably testing this with image files, so I'd suggest using an alternative path in the tutorial. Since the path makes sense though, we could also add a disclaimer in the tutorial. I really wasn't sure which is least disruptive.
The text was updated successfully, but these errors were encountered: