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
gefragt vor 9 Monaten90 Aufrufe
Keine Antworten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen