Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

206
Views
Nextjs components can't access env.local variables

I'm building a movie recommendation app and I'm trying to fetch over an Url that is defined on my .env.local file, however it seems that none of my components can access environment variables, but index.js and _app.js can. Is there any solution?

Edit: I don't know if this matters, but both my "pages" and "components" directories are on the same folder alongside the .env.local file.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You must use the prefix NEXT_PUBLIC_ if you want to access env variables from the client. Please checkout the documentation for more info: https://nextjs.org/docs/basic-features/environment-variables#exposing-environment-variables-to-the-browser

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!