Next js error, when I try to build on AWS Amplify with environment variables

0

When I deploy to AWS Amplify my next js app using the standard Build settings- version: 1 frontend: phases: preBuild: commands: - npm install build: commands: - npm run build artifacts: baseDirectory: .next files: - '/*' cache: paths: - node_modules//* everything works, but my application uses environment variables, when I change build settings to the settings to those in the documentation - version: 1 frontend: phases: preBuild: commands: - npm ci build: commands: - env | grep -e NEXTAUTH_URL -e NEXTAUTH_SECRET -e MONGODB_URI >> .env.production - env | grep -e NEXT_PUBLIC_ >> .env.production - npm run build artifacts: baseDirectory: .next files: - '/*' cache: paths: - node_modules//* - .next/cache/**/* , I get errors. What do I need to do?

asked a year ago79 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions