cli icon indicating copy to clipboard operation
cli copied to clipboard

Netlify CLI not consistently reloading edge functions when file is overwritten

Open wesbos opened this issue 2 years ago • 4 comments

Describe the bug

I am using remix with the @netlify/remix-edge-adapter. This bundles the remix server into an edge function at ./netlify/edge-functions/server.js

When I change a file that rebuilds the server, the above file is updated, but netfliy CLI doesn't realize a change, and thus doesn't reload function, so every time I make a change, I have to kill netlify dev and restart it. It does seem to work about 1 in 5-15 saves.

Video here of me replicating it: https://share.getcloudapp.com/L1uDojBD

Note it says "serving cache" in my logs- this has nothing to do with the edge function and isn't the issue here. https://wes.io/L1uDojBD

Steps to reproduce

see above

Configuration

[build] command = "remix build" publish = "public"

[dev] command = "remix watch" port = 3000 autoLaunch = false

[[headers]] for = "/build/*" [headers.values] "Cache-Control" = "public, max-age=31536000, s-maxage=31536000"

Environment

System: OS: macOS 13.0 CPU: (10) arm64 Apple M1 Max Memory: 5.18 GB / 64.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 18.12.1 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 9.5.0 - /usr/local/bin/npm npmGlobalPackages: netlify-cli: 12.14.0

wesbos avatar Feb 22 '23 19:02 wesbos

I looked at this briefly, and it doesn't appear to be frameworks related.

I thought maybe the cache: "manual" key (edge function caching) in the in-source config for the Netlify Edge Function that handles remix requests might have somehow been affecting local development, but @wesbos confirmed the same behaviour occurs without cache: "manual" set.

nickytonline avatar Feb 23 '23 19:02 nickytonline

@wesbos Thanks so much for opening up this issue ☺️ we released a new version of the CLI, namely v.13.1.5 which I hope solves this issue :) in case it didn't, please feel free to let us know!

khendrikse avatar Mar 14 '23 13:03 khendrikse

@khendrikse Thank you - seems like that didn't fix it though.

netlify-cli/13.1.6 darwin-arm64 node-v18.12.1

I have to hit reload between 5-40 times in order for it to reload the edge functions.

Also, @nickytonline I find that when it does trigger properly, the remix server refreshes before the compiled edge function is done, so I either see a broken page, or the old server info.

wesbos avatar Mar 14 '23 19:03 wesbos

@wesbos thanks for checking it out :) we'll dive in again!

khendrikse avatar Mar 15 '23 13:03 khendrikse