i have same problem but you can try to edit amplify.yml in build settings, for example if you use npm
version: 1
frontend:
phases:
preBuild:
commands:
- npm ci
build:
commands:
- echo "NEXT_NOTION_MARKETING_DATABASE_ID=$NEXT_NOTION_MARKETING_DATABASE_ID" >> .env
- echo "NEXT_NOTION_BUSINESS_DATABASE_ID=$NEXT_NOTION_BUSINESS_DATABASE_ID" >> .env
- npm run build
artifacts:
baseDirectory: .next
files:
- '**/*'
cache:
paths:
- node_modules/**/*
- .next/cache/**/*
this works like a charm, and you can try the docs from aws amplify environtment