Describe the bug
Cannot get my project to build using the amplify console. No obvious causes for the build to fail.
To Reproduce
Steps to reproduce the behavior:
amplify initamplify add api to create a new graphQL API. In my case I provided my own schema from another AWS AppSync project.amplify push your project to the amplify-console service.Amplify console backend Logs:
Expected behavior
I expect the app to build without errors.
Additional context
I found someone with a similar issue and they mentioned that specifying the npm version in the build script could alleviate the problem along with uninstalling and re-installing the amplify-cli. This hasn't worked for me.
Sample code
amplify.yml
version: 0.1
backend:
phases:
build:
commands:
- nvm use 10
- npm uninstall -g @aws-amplify/cli
- rm -rf node_modules/@aws-amplify/
- npm install -g @aws-amplify/[email protected]
- '# Execute Amplify CLI with the helper script'
- amplifyPush --simple
frontend:
phases:
preBuild:
commands:
- npm ci
build:
commands:
- npm run build
artifacts:
baseDirectory: dist
files:
- '**/*'
cache:
paths:
- node_modules/**/*
Upon looking at my github repo I noticed that the project directory name wasn't capitalized and was causing my project to not be found. Doesn't look like git respects casing by default. Configuring git using git config --local core.ignorecase false solved the problem.
@nickeyvee impressed you found a solution to that weird problem! We'd like to ensure other folks don't run into a similar issue. Some questions:
@swaminator Sorry for the late reply.
~/amplify/backend/api/<YOUR-API-NAME>/Thanks! Closing issue.
@swaminator Was this closed because it was fixed? I am having the same problem by the looks of things.
The odd thing is that I had the opposite problem than the OP. Amplify is looking for a case insensitive directory but git is storing it as case sensitive.
Renaming it in amplify/backend/backend-config.json and amplify/backend/api/foo/parameters.json seemed to do the trick.
The odd thing is that I had the opposite problem than the OP. Amplify is looking for a case insensitive directory but git is storing it as case sensitive.
I had the same issue with codebuild and amplify, it turns out we had a file changed from camelCase to lowercase and git obviously did not notice.
I solve renaming said file into lowercase (delete file -> commit -> add file with lowercase -> commit)