netlify / netlify/cli

Netlify CLI not consistently reloading edge functions when file is overwritten

Open
#5,494 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: bug
Dominant language
TypeScript
Stars
1.9k
Forks
474
Avg merge
23h 30m
Merged PRs (30d)
53

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the Netlify CLI using ./netlify/edge-functions/server.js and the provided Remix configuration, overwriting the generated file during netlify dev. Start by tracing the CLI's edge-function file watching and reload entry points. Done means repeated rebuilds consistently reload the edge function without restarting netlify dev.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.