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 not recognizing React app build directory code: MissingBuildArtifacts #3936

Closed
3 tasks done
samgates3 opened this issue May 31, 2024 · 4 comments
Closed
3 tasks done
Labels
archived This issue has been locked. feature-request New feature or request

Comments

@samgates3
Copy link

Before opening, please confirm:

Amplify Hosting feature

Build settings, Deployments

Is your feature request related to a problem? Please describe:

For a React 18 app

Build fails at the deploy phase, giving the Build artifacts not found error. I had not made any changes to build settings before this issue and have since tried a number of variations I have seen others use from other issues for the baseDirectory path including:

build
/build
./build
/app-name/build
./app-name/build

all give the same error.

Screenshot 2024-05-31 at 11 53 51 AM

Here are my build settings:

Default build image

version: 1
backend:
  phases:
    build:
      commands:
        - npm i -S graphql-ttl-transformer
        - '# Execute Amplify CLI with the helper script'
        - amplifyPush --simple
frontend:
  phases:
    preBuild:
      commands:
        - npm ci
    build:
      commands:
        - npm run build
  artifacts:
    baseDirectory: build
    files:
      - '**/*'
  cache:
    paths:
      - node_modules/**/*

I have also used - ls command after the build to confirm the build directory is created and all the files are there

Describe how you'd like this feature to work

I'd like to see what changes I can make to get this issue resolved.

@samgates3 samgates3 added the feature-request New feature or request label May 31, 2024
Copy link

This has been identified as a feature request. If this feature is important to you, we strongly encourage you to give a 👍 reaction on the request. This helps us prioritize new features most important to you. Thank you!

@samgates3
Copy link
Author

I was finally able to find a solution that worked on discord.

The platform was set to WEB_DYNAMIC somehow.

Using aws cli command: aws amplify update-app <APP_ID> --platform WEB --region <REGION> to set the platform to WEB. Then redeployed and everything worked as it did previously.

I don't know if the platform had always been set to WEB_DYNAMIC or WEB, but I did recently add a new branch for a migration to use NextJS and deployed that (it failed, likely because I will have to migrate to use the newer WEB_COMPUTE platform but that will be an issue for another day) and I wonder if that caused the platform to change if it changed at all?

Copy link

github-actions bot commented Jun 1, 2024

This issue is now closed. 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

github-actions bot commented Jun 1, 2024

This issue has been automatically locked.

@github-actions github-actions bot added the archived This issue has been locked. label Jun 1, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jun 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived This issue has been locked. feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant