How to store external image url as an enviroment variable in next.js?

Viewed 9

In .env.local I'm trying this:

BASE_URL=https://image.tmdb.org/t/p/original 
API_KEY=xxxx

The API_KEY works fine, but when I try to use the BASE_URL I get undefined

 <Image
    src={`${process.env.BASE_URL}${poster_path}`}
    height={375}
    width={250}
    alt="movie poster"
    layout="responsive"
/>

Why could this be?

0 Answers
Related