amplify-cli: Hosting - Creating a nested amplify project is not supported
Before opening, please confirm:
- I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
- 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.
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
16.10.0
Amplify CLI Version
7.6.7
What operating system are you using?
Mac
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
no
Amplify Categories
hosting
Amplify Commands
Not applicable
Describe the bug
Since today our hosting CI/CD crashes when building the backend with the error message: Creating a nested amplify project is not supported. Project root detected: /codebuild/output/srcxxxxxxx/src/xxxxxx Because the only change from our successful build was a little bit of frontend code, we already thought that this bug cant be due to our latest change, so for testing we rolled back to the last successful build, but the error still occurs.
Any ideas?
Expected behavior
CI/CD pipeline should build it like normal
Reproduction steps
Redeploy a version in CI/CD pipeline
GraphQL schema(s)
# Put schemas below this line
Project Identifier
No response
Log output
# Put your logs below this line
Additional information
No response
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 30 (7 by maintainers)
I’m facing the same problems too. There seems to be a problem with the new CLI version.
We experienced the same issue in trying to set up front end hosting (Next.js) for our existing backend. We have a monorepo with the
appRoot
set toweb
in theamplify.yml
file.Downgrading Amplify CLI to
9.1.0
worked around this error for us, too 👍Just an FYI I was running 9.2.1 and having this issue, I downgraded to my colleagues version at 9.1.0 and it worked
Hi @foobarnes, @bkmulusew can you check the path printed in the error message after
Project root detected:
and look for anamplify
directory in that path? If exists it might be that at some point an attempt was made to initialize an amplify project in the path printed in the error message? Can you remove/rename thatamplify
directory and retry theamplify init
command?I had an
amplify
directory created by mistake at a parent root. I deleted it and worked.Getting this problem too when running
amplify init
inside a blank directoryHey folks 👋 I’ve marked this as a documentation issue to improve the Hosting docs for monorepos. From your feedback here, it has become clear that the monorepo support with the buildspec
amplify.yml
file is confusing in that theappRoot
is whereamplifyPush --simple
will run, which expects anamplify/
directory in that root.Hi @lazpavel , This is happening in the backend during the “amplifyPush --simple” command. I modified my amplify,yml file to run pwd before and after the “amplifyPush --simple” script.
The output in the AWS Amplify console is:
I think “earthx/apps/earthxapp” should be correct for the Nx Monorepo setup. “aws-exports.js” gets placed in “apps/earthxapp/src” on my system.
My “amplify/.config/project-config.json” file contains:
Note that if I change the following Environment variable in the AWS Amplify console from (latest):
to (9.1.0):
Then everything compiles and deploys correctly.
Thanks for looking into this.
Hey @josefaidt,
Thank you for your help. Indeed we forgot to set the amplify build to our version and it was set to latest. After downgrading to our version it works again. Maybe this case might still be of interest to you.
BR Chris