process.env.URL undefined in netlify functions:serve

I’m using the netlify CLI and developing some netlify functions.

Using netlify dev, process.env.URL returns http://localhost:8888 as expected.

Until earlier today, I’m 99% certain that until earlier today, when using netlify functions:serve, process.env.URL returned http://localhost:9999 . Now it returns undefined. Any idea what might have changed or how I can troubleshoot this?

Ok, it looks like my working directory became unlinked from my netlify site.

After running netlify link, the problem is resolved.

Hi @paulrudy ! Thank you for sharing your solution with us. This will help other builders with their future problems.:netliconfetti:

1 Like