Hi!, I'm trying to deploy my NextJS app in Amplify, but I'm certainly struggling to accomplish it. I've been searching for possible solutions, but I cannot find a proper for my case. I'm getting the following error:
I have tried, as the troubleshooting documentation says, with this:
- allfiles=$(ls -al ./.next/standalone/**/*.js)
- npx esbuild $allfiles --minify --outdir=.next/standalone --platform=node --target=node16 --format=cjs --allow-overwrite
and changing my next.config.js with:
output: standalone
but in the build process I get and errors saying that the standalone folder cannot be find. Could you please help me to put some light on this?
This is my amplyfy.yml:
version: 1
frontend:
phases:
preBuild:
commands:
- nvm use $VERSION_NODE_16
- npx pnpm config set node-linker hoisted
- npx pnpm install
build:
commands:
- npx pnpm run build
artifacts:
baseDirectory: .next
files:
- '**/*'
cache:
paths:
- node_modules/**/*