I am hosting a NextJs 13 App on Amplify. In my custom _app.tsx
file, I have a getInitialProps
function that references an env-var not prefixed with NEXT_PUBLIC_
. This means that the variable will not be accessible outside the Node runtime. However, the initial load of getInitialProps
runs on the server, so this shouldn't be a problem.
However, when trying to access the variable, it is undefined. Other env-vars that are prefixed with NEXT_PUBLIC_
are, which means the process is not running on Node.
The app works as expected when run locally, which leads me to think this is an issue with how Amplify hosts the app.