Skip to content

Next.js SSR mode - Environment Variables not being carried over to the created Lambda Functions #1987

@joelvarty

Description

@joelvarty

Before opening, please confirm:

App Id

d36aqre3ndgr2h

Region

us-east-1

Amplify Console feature

Environment variables

Describe the bug

When I set environment variables in the Amplify app, they are NOT being carried through to the Lambda functions that are automatically created for my Next.js SSR website.

Even if I set the environment variables later on the Lambda functions that are created, they get wiped out the next time I do a build.

Here's a link to my repo: https://github.com/agility/agilitycms-nextjs-ssr-starter

Expected behavior

I expected the environment variables to propagate from the Amplify settings to the Lambda functions that are created.

Reproduction steps

  • Create a new Next.js site on Amplify site using this repo: https://github.com/agility/agilitycms-nextjs-ssr-starter
  • Set the environment variables as needed (let me know if you need this information specifically)
  • Push a change to the main branch
  • The Environment variables are NOT on the Lambda functions.
  • The code in the Lambda functions that uses process.env.VARIABLE_NAME doesn't work

Build Settings

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    archivedThis issue has been locked.ssrServer Side Rendering feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions