-
Notifications
You must be signed in to change notification settings - Fork 822
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
Error: Can't resolve './amplifyconfiguration.json' in build stage #13451
Comments
Hey @LennyRamos, thank you for reaching out. This appears to be happening on you frontend build phase on AWS Amplify console. Does the cicd yml script have a backend build phase with
as this should push your backend and generate the config file. |
Ohhh that's awesome! Would I drop that in the "amplify.yml" file that was generated for the amplify project? All pps > App > App settings: Build settings ? Currently, I only see the frontend in the yml. with the following: version: 1 I attached the backend env that I am using but it doesnt seem like that updates the yml |
One last question, I see from these docs that they have a sample yml syntax does it matter if I place the backend build before front end? For more clarity, in the build logs I do see the backend being built, just no yml for it, |
From what you said and what's in these logs, im assuming I just need to drop those build commands in the amplify.yml? 2023-12-05T16:17:45.281Z [INFO]: ✅ Initialized your environment successfully. |
I first tried changing the yml in the UI and build but that failed. Then I downloaded the yml and placed it at root of project. I saw that when I rebuild the project with the yml in root it was executing. same error Here it is 2023-12-05T23:45:49.850Z [INFO]: Creating an optimized production build... |
comparing my logs to others I also have this error at the beginning, not sure if related 2023-12-06T00:30:40.019Z [INFO]: # Checking for Git submodules at: /codebuild/output/src2466364651/src/frontend/.gitmodules |
Does the |
@charlieforward9 https://docs.amplify.aws/javascript/tools/cli/start/key-workflows/#amplify-push |
Hey, running |
No, locally everything runs pretty smooth and well. I am able to launch my project and interact with it on localhost |
Is there a message for when that file gets generated? I see that for aws.exports.js there is a message but not for amplifyconfiguration
Am I suppose to see this message in the output? |
@LennyRamos interesting the looking into the logs the backend build seems to be running as expected.
in the yml file could you try listing the files by adding |
Will do and relay what I see. For future reference, is there a way to remote into the docker containers where the app is built? |
amplify.yml
Logs of ls src
Im pretty sure the error is that the pipeline is not executing the amplify.yml in build settings is also the same structure as the one in git, just without the ls src |
I see these messages too
is this looking for a cache of an old amplify.yml and using that? thats the only thing i can think of |
@LennyRamos is the Amplify CLI on the build setting set to latest? looking at the |
@ykethan right on the money 🤑🤑🤑
where can i update the version in the build settings? locally i am using |
@LennyRamos great, we can change to latest version by using any of the following methods.
|
@LennyRamos actually just noticed the package override does not have any Amplify CLI. |
@ykethan Thanks a bunch in helping me debug this!!! |
Glad to hear you were able to get a successful build, i will be closing the issue for now. Please feel free in reaching out to us again. |
|
Amplify CLI Version
12.8.2
Question
So I have everything wired up. Backend and Frontend.
I am running the CI/CD pipeline to build and deploy the app.
In the build stage, it gets to this error:
2023-12-05T16:18:38.760Z [INFO]: Creating an optimized production build...
2023-12-05T16:18:39.438Z [INFO]: Failed to compile.
2023-12-05T16:18:39.438Z [INFO]: Module not found: Error: Can't resolve './amplifyconfiguration.json' in '/codebuild/output/somepath/src'
2023-12-05T16:18:39.452Z [ERROR]: !!! Build failed
2023-12-05T16:18:39.453Z [ERROR]: !!! Non-Zero Exit Code detected
This makes sense given that it is pulling the project from Git Hub and that file was not committed.
What is the work around this? I have read not to commit either amplifyconfiguration.json or aws-exports.js, so i haven't
More information, building off of main branch in repo
Thanks!
The text was updated successfully, but these errors were encountered: