Max allowed size error in Amplify deployment

0

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:

Enter image description here

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/**/*
K Ortiz
asked 9 months ago85 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