NextJS public environment variables are not recognized in my elastic beanstalk

18 views Asked by At

Here is my problem : I have a NextJS 14 application with app router, that I would like to deploy on Elastic Beanstalk.

I have some variables NEXT_... and variables NEXT_PUBLIC_....

I write them in my Elastic Beanstalk configuration. But the problem is that I have a client page that should use my NEXT_PUBLIC_... variables to create a redirect URL. But when I hover my button with the redirect URL, I have some undefined instead of my public variables.

My variables are well written in my application and my configuration, no spelling problems.

Can someone explain me how can I send my NEXT_PUBLIC_... variables to my client page ? Do I necessarily need to write a .env file for my public variables ?

Thanks in advance.

Regards.

0

There are 0 answers