aws-amplify / amplify-hosting

AWS Amplify Hosting provides a Git-based workflow for deploying and hosting fullstack serverless web applications.
https://aws.amazon.com/amplify/hosting/
Apache License 2.0
459 stars 116 forks source link

[NEXTJS] Starting SSR Build...Error #1889

Closed andrewgadziksonos closed 3 years ago

andrewgadziksonos commented 3 years ago

Before opening, please confirm:

App Id

d1i7qtt97aq61n

Region

us-east-2

Amplify Console feature

Logging

Describe the bug

My NextJS application fails to build without any additional information. The build logs contain the following,

2021-05-28T12:39:53.668Z [INFO]: Starting SSR Build...
2021-05-28T12:40:49.064Z [INFO]: Error

Expected behavior

I would expect to see detailed error messaging around why the build is failing

Reproduction steps

  1. Launched Amplify console
  2. Created a new project based on my Github repository
  3. Selected defaults
  4. Finished creating project, CICD kicked off - Build failed

Build Settings

version: 1
frontend:
  phases:
    preBuild:
      commands:
        - yarn install --frozen-lockfile
    build:
      commands:
        - yarn build
  artifacts:
    baseDirectory: .next
    files:
      - '**/*'
  cache:
    paths:
      - node_modules/**/*

Additional information

I tried using NODE_OPTIONS=--max-old-space-size=5120 but this didnt resolve the issue

I followed along here as well

1853

1874

1882

jeremyrajan commented 2 years ago

Same here +1

ocordova commented 2 years ago

Adding config to serverSideTranslations fixed it for me. ...(await serverSideTranslations(locale, ['common'], nextI18NextConfig)),

Originally posted by @crathert in https://github.com/isaachinman/next-i18next/issues/990#issuecomment-943438144

salman-codewar commented 2 years ago

I'm using NextJS v12 and getting this error, Can't resolve 'webpack' Screen Shot 2022-04-28 at 16 25 06

I resolved it by setting outputStandalone to false.

/* next.config.js */
module.exports = {
  experimental: {
    outputStandalone: false,
  },
};
github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.