Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amplify hangs at Build phase with no errors for subfolders package installation #3830

Closed
5 tasks done
clukhei opened this issue Nov 28, 2023 · 3 comments
Closed
5 tasks done
Labels
archived This issue has been locked. pending-triage

Comments

@clukhei
Copy link

clukhei commented Nov 28, 2023

Before opening, please confirm:

  • I have checked to see if my question is addressed in the FAQ.
  • I have searched for duplicate or closed issues.
  • I have read the guide for submitting bug reports.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.

App Id

d1fusmcnk5bd8d

AWS Region

us-east-1

Amplify Hosting feature

Frontend builds

Frontend framework

Jekyll

Next.js version

N/A

Next.js router

N/A

Describe the bug

I rearranged my project into folders where each folder runs its own package installation and build. However at Build step, amplify console hangs after npm installation (and sometimes during jekyll bundle install) with no errors.

I read that amplify's example to cd into a project folder and also tried monorepo

Project directory :
Screenshot 2023-11-28 at 10 28 30 AM

Context:
My project requires to setup lib folder with npm ci and npm run build and subsequently portal folder should run npm ci , bundle install and npm run build. portal folder outputs a jekyll static site in portal/_site folder which are the artifacts. lib folder is a webpack project and its build will output a css file into portal folder.

I have also tried monorepo but it always fails at certain npm installation or bundle installation with no errors until build timed out at 30 min mark. All the commands that I've written in amplify is tested in local and works.

This is the amplify file which I have tried , also commented out and run simple cd lib and npm ci but it still hanged
Amplify file:

version: 1.0
frontend:
  phases:
    preBuild:
      commands:
        # - rvm get stable && rvm install 3.0.0
        # - rvm use 3.0.0
        # - gem install bundler -v '=2.3.13'
        - cd lib && npm ci
        # - cd ../portal
        # - pwd
        # - npm ci
    build:
      commands:
        # - cd ../lib && npm run build
        # - cd ../portal
        # - bundle update --bundler
        # - bundle install
        # - ls -a
        # - pwd
        - |
          if [ "${AWS_BRANCH}" = "v2" ]
          then 
            JEKYLL_ENV=production npm run build
          else
            npm run build
          fi
        - ls -a

  artifacts:
    baseDirectory: portal/_site
    files:
      - '**/*'
  cache:
    paths: [] 

Amplify Console screenshot:
Screenshot 2023-11-28 at 10 36 06 AM

Monorepo settings
I also tried monorepo although im not sure if the project is considered a monorepo as lib folder is more of a dependency than it is an app. I only need to serve static files from portal folder , but portal folder relies on lib folder. But regardless, I couldnt get pass the installation phase.

Amplify file:

version: 1
applications:
  - appRoot: lib
    frontend:
      buildPath: /
      phases:
        preBuild:
          commands:
            - npm ci 
        build:
          commands:
            - npm run build
      artifacts:
        files:
            - '**/*'
        baseDirectory: /
      cache:
        paths: []

  - appRoot: portal
    frontend:
      buildPath: /
      phases:
        preBuild:
          commands:
            - rvm get stable && rvm install 3.0.0
            - rvm use 3.0.0
            - gem install bundler -v '=2.3.13'
            - bundle update --bundler
            - bundle install
            - npm ci
        build:
          commands:
            - |
              if [ "${AWS_BRANCH}" = "v2" ]
              then 
                JEKYLL_ENV=production npm run build
              else
                npm run build 
              fi
              
      artifacts:
        files:
            - '**/*'
        baseDirectory: /
      cache:
        paths: []

Amplify console :
hangs here
Screenshot 2023-11-28 at 10 51 38 AM

Previously, amplify was working for me when everything was in root folder. I am wondering if there is something buggy about subfolders package installation for amplify?

Expected behavior

I expect that the console should output an error instead of hanging indefinitely till build time out.

Reproduction steps

see description

Build Settings

see description

Log output

see description

Additional information

No response

@clukhei
Copy link
Author

clukhei commented Nov 28, 2023

Closing this thread as I realise it was an error on my end.

@clukhei clukhei closed this as completed Nov 28, 2023
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Copy link

This issue has been automatically locked.

@github-actions github-actions bot added the archived This issue has been locked. label Nov 28, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Nov 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived This issue has been locked. pending-triage
Projects
None yet
Development

No branches or pull requests

1 participant