cloudflare pages undefined environment variables
Unanswered
Sloth bear posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/5.png)
Sloth bearOP
does anybody know why environment variables are undefined when hosting a next.js project on cloudflare pages? they show up under build settings on the cloudflare pages build
11 Replies
![Avatar](https://cdn.discordapp.com/avatars/1011594178934878248/3dcc464b55267c406f84c2c541ac00df.webp?size=256)
averydelusionalperson
IDK much about cloudfare pages, but you have added the environment variables under settings right?
![Avatar](https://cdn.discordapp.com/embed/avatars/5.png)
Sloth bearOP
yep, it shows the environment variables along with the deployment
![Avatar](https://cdn.discordapp.com/avatars/1011594178934878248/3dcc464b55267c406f84c2c541ac00df.webp?size=256)
averydelusionalperson
where are you getting those as undefined?
In Next.js application?
![Avatar](https://cdn.discordapp.com/embed/avatars/5.png)
Sloth bearOP
in ssr pages
yeah
![Avatar](https://cdn.discordapp.com/avatars/1011594178934878248/3dcc464b55267c406f84c2c541ac00df.webp?size=256)
averydelusionalperson
I never used cloudfare pages, but you need to access .env in particular way in cloudfare pages if I'm not wrong.
I'm not sure tho, you can check ^ this out
![Avatar](https://cdn.discordapp.com/avatars/1011594178934878248/3dcc464b55267c406f84c2c541ac00df.webp?size=256)
averydelusionalperson
Hey @Sloth bear , did you found the solution?