-
Notifications
You must be signed in to change notification settings - Fork 825
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
Hosting - Creating a nested amplify project is not supported #10832
Comments
Hey @chris-mds 👋 thanks for raising this! Based on the repo I have a few follow-up questions:
|
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 |
I am also getting this error on the latest CLI version. Should I open a new issue or reopen this one? No changes to
|
I'm facing the same problems too. There seems to be a problem with the new CLI version. |
Hi @foobarnes, @bkmulusew can you check the path printed in the error message after |
Getting this problem too when running |
@lazpavel I am having the same issue. It appears to be related to your commit #10744 . I am using an Nx Monorepo with the following amplify.yml.
The error I am getting is:
It appears someone else is also having this issue when using a monorepo. See #2908 Does this commit break Monorepos, or am I doing something wrong? Thanks |
Hi @jeffearthx, is the |
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. |
I am trying to understand your folder structure, it looks that the |
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 |
@NickEast12 it worked for me. For any reason the amplify version 9.2.1 broken for me... thanks |
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 Downgrading Amplify CLI to |
Same issue for me. Downgrading to 9.1.0 solved it. |
Wanted to +1 here. Also was trying to set up front end hosting for our existing backend. Downgrading to 9.1.0 solved this issue. |
For me the mistake was that for some reason I had different appIds from the project. Steps to solve
|
Hey 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
|
Hi @josefaidt! It's possible documentation can be improved, but was there an intentional, breaking change from Amplify CLI The Monorepo setup works great in Amplify CLI Here's our setup:
The Thanks! |
Hey @brianlenz
This was an intentional change but was not meant to break existing workflows where this fix uncovered a subtle difference in the monorepo support. Previously the functionality would have pulled your The monorepo support functionality is to enable folks to have multiple Amplify projects in a single repo, where we can connect the same repo to multiple apps for automated builds.
Great question! The short answer is no, you need not to duplicate this directory. Instead, it may be worth exploring the following options:
I'll be working closely with a few folks from the Amplify Hosting team to get this documentation and guide updated 🙂 |
@josefaidt, thanks much for the quick response! We don't do any automated backend builds or pushes (we have Enable full-stack continuous deployments (CI/CD) turned off). We have an Amplify backend configured, but we manage it purely through the Amplify CLI (with manual invocations of Contrary to the use case you mentioned, we have a single Amplify project (so, a single backend) that we use with multiple Amplify "front ends" (one React Native, one Next.js). React Native is built manually, of course, but the Next.js uses automated builds through Amplify Hosting, which is where our Amplify CLI option is forced to It seems that your suggestions are focused on automated backend builds and pushes, which we don't do. Our problem is purely with the Amplify Hosting build process for the Next.js front end. As such, I'm not sure the options that you suggested are relevant to our use case? Does this added context give you any other ideas as to how we might upgrade to the latest Amplify CLI? FWIW, this:
sounds like exactly what we want and need. It's unfortunate that it's no longer supported on the latest versions of the Amplify CLI 😕 |
Error: Creating a nested amplify project is not supported. Project root detected: /Users/suyashkhandare Downgrading to 9.1.0. Won't work |
I am getting this error on amplify init , try to add amplify to a new Xcode project |
Hey @neal3000 do you have an |
I'm also facing the same problem. |
I had an |
I had an |
I am having this problem. I have tried all the suggestions above to no avail. I have a monorepo with my web pages in the web/ subdirectory of the repo. I cannot find another instance of |
I had the same issues as above, a mono repo with the /amplify directory above the /artifacts/web appRoot. Managed to solve it by changing the build.yml file in Amplify Console. Didn't want to change my structure or downgrade, here's the script.
|
Didn't they retire https://github.com/aws-amplify/amplify-hosting/blob/main/scripts/amplifyPush.sh |
This might not be useful, but I just started experiencing this issue as well. Amplify CLI version on my workstation: 12.10.0 project structure:
Up until todays push, everything was working fine, but I pushed a bunch of changes to backend (updated functions, changed schema etc) AND the amplify.yml file and receive that error now. I tried a couple of the solutions here to no avail. The amplify.yml file: version: 1
backend:
phases:
# IMPORTANT - Please verify your build commands
preBuild:
commands:
- npm install -g @aws-amplify/cli
build:
commands:
- ln -fs /usr/local/bin/pip3.8 /usr/bin/pip3
- ln -fs /usr/local/bin/python3.8 /usr/bin/python3
- pip3 install --user pipenv
#- pip3 install --upgrade setuptools
- '# Execute Amplify CLI with the helper script'
- amplifyPush --simple
frontend:
phases:
preBuild:
commands:
- npm ci
build:
commands:
- echo "VUE_APP_RECAPTCHA=$RECAPTCHA" >> .env
- echo "VUE_APP_GOOGLE_SITE_KEY=$GOOGLE_SITE_KEY" >> .env
- npm run build
artifacts:
baseDirectory: dist/spa
files:
- '**/*'
cache:
paths:
- node_modules/**/*
test:
phases:
preTest:
commands:
- if [ "${AWS_BRANCH}" = "test" ]; then echo "test branch"; fi
test:
commands:
#-if [ "${AWS_BRANCH}" = "test" ]; then curl -X POST https://app.testsigma.com/api/v1/execution_results -H '"Content-type:application/json"' -H "Authorization:$TESTSIGMA_API_KEY" -d '{"executionId":"651"}'; fi
postTest:
commands:
- if [ "${AWS_BRANCH}" = "test" ]; then echo "test completed"; fi
artifacts:
baseDirectory: dist/spa
files:
- '**/*' If I remove the |
Hey y'all I just wanted to offer another solution. I had this issue because I accidentally committed my amplify folder to github which causes the nested issue. |
Before opening, please confirm:
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
Additional information
No response
The text was updated successfully, but these errors were encountered: