update amplify project from react to nextjs - Error: The "target" property is no longer supported in next.config.js

125 views Asked by At

I have a project in amplify, originally it was created only with react, now its being migrated to next js, locally the project run as expected. However when try to enable the auto-deploys from amplify console I'm getting this error:

Error: The "target" property is no longer supported in next.config.js.

PD: Im working with next js v13 and I verify that the target property is not used in next.config.js. I check some tutorials and saw that Framework under general settings should be next js - SSR but mine is React - Amplify, not sure if its related

The build.settings is the following:

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

I expected that app be deployed successfully

1

There are 1 answers

0
PRASAD GOWDA On

re-install version 13 next.js config file and make sure to delete "target: 'serverless'" inside module.exports = {} block, It'll helps you