}
 
export default Page
Next.js will replace process.env.customKey with 'my-value' at build time. Trying to destructure process.env variables won't work due to the nature of webpack DefinePlugin.
For example, the following line:
 return <h1>The value of customKey is: {process.env.customKey}</h1>
Will end up being:
 return <h1>The value of customKey is: {'my-value'}</h1>