#DATABASE_URL env var not found

1 messages · Page 1 of 1 (latest)

dapper bluff
#

I followed the docs and guide in my build settings i have

        build:
          commands:
            - echo "DATABASE_URL=$DATABASE_URL" >> .env

and in runtime the var still cant be used in prisma.

I can still access the variable in my nextjs app but the actual .env isnt there.

finite wren
#

kk

bleak sinew
#

Hi @dapper bluff 👋 , to make specific environment variables accessible to Next.js, you will need to modify the Amplify build specification file (amplify.yml) to set them in the environment files that Next.js recognizes. An example is outlined here: https://docs.aws.amazon.com/amplify/latest/userguide/ssr-environment-variables.html

dapper bluff