Azure / static-web-apps

Azure Static Web Apps. For bugs and feature requests, please create an issue in this repo. For community discussions, latest updates, kindly refer to the Discussions Tab. To know what's new in Static Web Apps, visit https://aka.ms/swa/ThisMonth
https://aka.ms/swa
MIT License
320 stars 54 forks source link

Next 13 Deployment Issue from Bitbucket to Azure Static Web App #1239

Open cemcevik opened 1 year ago

cemcevik commented 1 year ago

I'm having trouble deploying my Next 13.4.12 app from Bitbucket to Azure Static Web App using the steps in the following guide: https://learn.microsoft.com/en-us/azure/static-web-apps/bitbucket?tabs=react

When I run the pipeline, it's getting stuck at Creating an optimized production build step.

Moreover, I deployed the identical project using GitHub Actions, and it worked without any issues.

[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 52.30s.
yarn run v1.22.15
$ next build
- warn No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry
- info Creating an optimized production build...

Here is the bitbucket-pipeline.yml

pipelines:
  branches:
   master:
    - step: 
        name: Deploy to test
        deployment: test
        script:
          - pipe: microsoft/azure-static-web-apps-deploy:main
            variables:
                REQUIRED_OS_PACKAGES: nasm
                APP_LOCATION: '$BITBUCKET_CLONE_DIR'
                API_LOCATION: '$BITBUCKET_CLONE_DIR/src/app/api'
                OUTPUT_LOCATION: '$BITBUCKET_CLONE_DIR/out'
                APP_BUILD_COMMAND: yarn build
                API_TOKEN: $deployment_token

Here is the next.config.js

/** @type {import('next').NextConfig} */
const nextConfig = {
    output: "standalone",
};

module.exports = nextConfig;

Here is the package.json

"scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
},
thomasgauvin commented 1 year ago

Hi @cemcevik, can you detail your error logs? It seems that the logs you provided are not erroneous and the build is happening as expected

cemcevik commented 1 year ago

Hi @thomasgauvin, thank you for your response.

The problem I'm facing is that even though there aren't any errors in the logs, the pipeline gets stuck at the Creating an optimized production build step and doesn't continue. It doesn't throw any errors.

I've included the full logs of the pipeline below: pipelineLog-{8caa6ed4-326b-4b9d-96f3-ad39e15274ff}.txt

What's interesting is that I've deployed the same project with GitHub Actions, and it worked without any problems.

anishbishnoi127 commented 1 year ago

same with me . nextjs 13.4.12 production build and deployment failed.

anishbishnoi127 commented 1 year ago

@cemcevik are you able to solve it ?

cemcevik commented 1 year ago

Hello @anish-dev-127 no, unfortunately not.

The problem still exists.

DjilanMouhous commented 11 months ago

Hi @cemcevik , did you check if it is not related to docker max size ? I had a similar issue and increasing docker size worked for me definitions: services: docker: memory: 2048