In my Next.js app I've created a .env file with a variable named API_KEY.
Destructuring the value results in undefined, as shown here:
const { API_KEY } = process.env; // = undefined
const key = process.env.API_KEY; // = 'value'
Can someone please explain why process.env isn't populated with the correct value here?