Describe the bug
Running edge functions locally with netlify dev, Deno.env contains all environment variables inherited from the CLI's shell. This is different from production, where it will only contain env vars specified in the Netlify UI, and two Deno-specific ones. This should be replicated in local dev.
One possible solution is to work with downstream @netlify/edge-bundler, and pass the --allow-env=... flag to only allow access to the environment variables that'd also exist in production:
https://github.com/netlify/edge-bundler/blob/0d2c6af674d30f0322bf376ad66acb0d5b5b0124/src/server/server.ts#L113
Steps to reproduce
Write an edge function, log Deno.env.toObject(). It should contain just placeholders for DENO_REGION and DENO_DEPLOYMENT_ID (probably not even that), but instead it contains all env vars inherited from the CLI's shell.
Configuration
No response
Environment
not relevant
Describe the bug
Running edge functions locally with
netlify dev,Deno.envcontains all environment variables inherited from the CLI's shell. This is different from production, where it will only contain env vars specified in the Netlify UI, and two Deno-specific ones. This should be replicated in local dev.One possible solution is to work with downstream
@netlify/edge-bundler, and pass the--allow-env=...flag to only allow access to the environment variables that'd also exist in production:https://github.com/netlify/edge-bundler/blob/0d2c6af674d30f0322bf376ad66acb0d5b5b0124/src/server/server.ts#L113
Steps to reproduce
Write an edge function, log
Deno.env.toObject(). It should contain just placeholders forDENO_REGIONandDENO_DEPLOYMENT_ID(probably not even that), but instead it contains all env vars inherited from the CLI's shell.Configuration
No response
Environment
not relevant