process.env not polyfilled for Edge Functions in CLI #1864
Labels
good first issue
Good for newcomers
priority: medium
type: bug
code to address defects in shipped code
Describe the bug
This report is coming from a user here: https://answers.netlify.com/t/82464
They're trying to use environment variables in their Next.js code using
process.env
which is native to any Next.js developer. Since the middleware is running on Edge Functions (in production as well as in CLI), the correct syntax isDeno.env
instead ofprocess.env
. In our production environment, we polyfill this, so users can get a seamless experience. However, it appears that the polyfill is missing in CLI.Steps to reproduce
There's a code example in the thread above, which can cause this issue.
Configuration
No response
Environment
Sharing my system details, but should happen on any system (with current latest version of CLI - v12.5.0):
The text was updated successfully, but these errors were encountered: