I have a build that deploys fine using the CLI but not with the Amplify Console. The build log reports that it Cannot find file './components/SurveyContainer' in './src'. The repo is currently private, but I can show more if necessary.
The response during the frontend build activity is:
# Starting phase: build
2019-02-19T05:14:34.755Z [INFO]: # Executing command: yarn run build
2019-02-19T05:14:34.922Z [INFO]: yarn run v1.13.0
2019-02-19T05:14:34.973Z [INFO]: $ react-scripts build
2019-02-19T05:14:36.211Z [INFO]: Creating an optimized production build...
2019-02-19T05:14:40.807Z [INFO]: Failed to compile.
2019-02-19T05:14:40.809Z [INFO]: ./src/App.jsx
Cannot find file './components/SurveyContainer' in './src'.
2019-02-19T05:14:40.832Z [WARNING]: error Command failed with exit code 1.
2019-02-19T05:14:40.834Z [INFO]: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
2019-02-19T05:14:40.838Z [ERROR]: !!! Build failed
2019-02-19T05:14:41.791Z [ERROR]: !!! Non-Zero Exit Code detected
2019-02-19T05:14:41.792Z [INFO]: # Starting Environment Caching...
2019-02-19T05:14:41.792Z [INFO]: Uploading environment cache artifact...
2019-02-19T05:14:41.905Z [INFO]: # Environment Caching completed
Terminating logging...
@funkfinger can you share your build settings? Found in App settings > Build settings in the nav bar on the left.
Sure, I have not made any changes to the original generated build settings:
version: 0.1
backend:
phases:
build:
commands:
- '# Get Amplify CLI Cloud-Formation stack info from environment cache'
- export STACKINFO="$(envCache --get stackInfo)"
- '# Execute Amplify CLI with the helper script'
- amplifyPush --environment $USER_BRANCH
- '# Store Amplify CLI Cloud-Formation stack info in environment cache'
- >-
envCache --set stackInfo "$(amplify env get --json --name
$USER_BRANCH)"
frontend:
phases:
preBuild:
commands:
- yarn install
build:
commands:
- yarn run build
artifacts:
baseDirectory: build
files:
- '**/*'
cache:
paths:
- node_modules/**/*
Let me add that the the code was bootstrapped from create-react-app - here is my package.json
{
"name": "echo19-web-survey-client",
"version": "0.1.0",
"private": true,
"dependencies": {
"aws-amplify": "^1.1.19",
"bootstrap": "^4.2.1",
"jquery": "^3.3.1",
"popper.js": "^1.14.6",
"prop-types": "^15.6.2",
"react": "^16.7.0",
"react-dom": "^16.7.0",
"react-scripts": "2.1.3"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"devDependencies": {
"enzyme": "^3.8.0",
"enzyme-adapter-react-16": "^1.7.1",
"eslint-config-airbnb": "^17.1.0",
"eslint-config-prettier": "^3.4.0",
"eslint-plugin-prettier": "^3.0.1",
"jest-enzyme": "^7.0.1",
"jest-fetch-mock": "^2.1.0",
"prettier": "^1.15.3"
},
"jest": {
"collectCoverageFrom": [
"src/**/*.{js,jsx,ts,tsx}",
"!<rootDir>/node_modules/",
"!src/graphql/*",
"!src/serviceWorker.js",
"!src/index.js"
]
}
}
Thanks. Two more things:
1) What is your apps directory structure? (Eg. CRAs directory structure looks like this: https://facebook.github.io/create-react-app/docs/folder-structure) When you run builds locally, what is the working directory from which you execute the build commands? I'm wondering whether you're seeing this because you have to 'cd' into a folder?
2) Can you share your app ARN? Found under App settings > General
Here is the AWS app ARN:
arn:aws:amplify:us-east-1:924685066025:apps/d26s3osbpr5bae
I do everything from the root of the project. All of the source files are in the src folder. amplify publish runs correctly from the project root directory as does yarn build, yarn start, amplify push, etc....
Here is the directory structure of the project (ignoring node_modules, .git and coverage folders)- sorry if it's more than you need
Jays-MacBook:echo19-web-survey-client jayw$ find . -ls \( -name 'node_modules' -o -name '.git' -o -name 'coverage' \) -maxdepth 10 -prune -print | sed -e 's;[^/]*/;|____;g
;s;____|; |;g'
4396971344 0 drwxr-xr-x 16 jayw staff 512 Feb 18 23:14 .
|____.DS_Store
|____node_modules
|____node_modules
|____.graphqlconfig.yml
|____amplify
| |____.config
| | |____project-config.json
| | |____local-aws-info.json
| | |____local-env-info.json
| |____#current-cloud-backend
| | |____backend-config.json
| | |____hosting
| | | |____S3AndCloudFront
| | | | |____parameters.json
| | | | |____template.json
| | |____api
| | | |____websurveyclient
| | | | |____parameters.json
| | | | |____schema.graphql
| | | | |____build
| | | | | |____schema.graphql
| | | | | |____resolvers
| | | | | | |____Mutation.updateSurvey.response
| | | | | | |____Mutation.deleteSurvey.request
| | | | | | |____Query.getSurvey.response
| | | | | | |____Query.listResponses.response
| | | | | | |____Mutation.updateResponse.request
| | | | | | |____Mutation.deleteResponse.response
| | | | | | |____Query.getSurvey.request
| | | | | | |____Mutation.deleteSurvey.response
| | | | | | |____Mutation.deleteResponse.request
| | | | | | |____Mutation.createResponse.request
| | | | | | |____Query.getResponse.response
| | | | | | |____Query.listSurveys.request
| | | | | | |____Mutation.createSurvey.request
| | | | | | |____Mutation.updateSurvey.request
| | | | | | |____Mutation.updateResponse.response
| | | | | | |____Query.listSurveys.response
| | | | | | |____Query.listResponses.request
| | | | | | |____Mutation.createSurvey.response
| | | | | | |____Mutation.createResponse.response
| | | | | | |____Query.getResponse.request
| | | | |____cloudformation-template.json
| | |____amplify-meta.json
| |____backend
| | |____backend-config.json
| | |____awscloudformation
| | | |____nested-cloudformation-stack.yml
| | |____hosting
| | | |____S3AndCloudFront
| | | | |____parameters.json
| | | | |____template.json
| | |____api
| | | |____websurveyclient
| | | | |____parameters.json
| | | | |____schema.graphql
| | | | |____build
| | | | | |____schema.graphql
| | | | | |____resolvers
| | | | | | |____Mutation.updateSurvey.response
| | | | | | |____Mutation.deleteSurvey.request
| | | | | | |____Query.getSurvey.response
| | | | | | |____Query.listResponses.response
| | | | | | |____Mutation.updateResponse.request
| | | | | | |____Mutation.deleteResponse.response
| | | | | | |____Query.getSurvey.request
| | | | | | |____Mutation.deleteSurvey.response
| | | | | | |____Mutation.deleteResponse.request
| | | | | | |____Mutation.createResponse.request
| | | | | | |____Query.getResponse.response
| | | | | | |____Query.listSurveys.request
| | | | | | |____Mutation.createSurvey.request
| | | | | | |____Mutation.updateSurvey.request
| | | | | | |____Mutation.updateResponse.response
| | | | | | |____Query.listSurveys.response
| | | | | | |____Query.listResponses.request
| | | | | | |____Mutation.createSurvey.response
| | | | | | |____Mutation.createResponse.response
| | | | | | |____Query.getResponse.request
| | | | |____cloudformation-template.json
| | |____amplify-meta.json
| |____team-provider-info.json
|____README.md
|____yarn.lock
|____public
| |____favicon.ico
| |____index.html
| |____questions.json
| |____manifest.json
|____.gitignore
|____package.json
|____.eslintignore
|____build
| |____precache-manifest.9632c3890f64fb78b74a2be0863cd788.js
| |____favicon.ico
| |____index.html
| |____asset-manifest.json
| |____questions.json
| |____static
| | |____css
| | | |____main.8c0c0b88.chunk.css.map
| | | |____1.ed5c4b6d.chunk.css
| | | |____1.ed5c4b6d.chunk.css.map
| | | |____main.8c0c0b88.chunk.css
| | |____js
| | | |____main.79bd4735.chunk.js.map
| | | |____1.8f792331.chunk.js.map
| | | |____runtime~main.229c360f.js.map
| | | |____1.8f792331.chunk.js
| | | |____main.79bd4735.chunk.js
| | | |____runtime~main.229c360f.js
| |____manifest.json
| |____service-worker.js
|____.git
|____.git
|____coverage
|____coverage
|____src
| |____research
| | |____graphQL.test.js
| |____aws-exports.js
| |____mock
| | |____questions.json
| |____QuestionParser
| | |____questionConverter.js
| | |____QuestionParser.js
| | |____questionConverter.test.js
| | |____QuestionParser.test.js
| |____App.css
| |____index.js
| |____index.css
| |____questionFetcher
| | |____questionFetcher.js
| | |____questionFetcher.test.js
| |____components
| | |____SurveyContainer.jsx
| | |____SurveyContainer.test.jsx
| | |____Question
| | | |____Question.test.jsx
| | | |____Question.jsx
| | |____QuestionOptionButton
| | | |____QuestionOptionButton.jsx
| | | |____QuestionOptionButton.test.jsx
| | |____QuestionOptions
| | | |____QuestionOptions.jsx
| | | |____QuestionOptions.test.jsx
| |____graphql
| | |____subscriptions.js
| | |____mutations.js
| | |____schema.json
| | |____queries.js
| |____.prettierrc
| |____App.jsx
| |____serviceWorker.js
| |____setupTests.js
| |____logo.svg
| |____.eslintrc.json
| |____App.test.jsx
@funkfinger, it seems like you simply can't find the module. Did you check your repo contains that file. If yes, you can add more commands like find ./src/component/ -name "*.js" to see what's exactly under
that folder. I forked your public repo with similar name which works well.
Thanks for looking into this- did you fork the dev branch? The error that is showing in the build process is:
Cannot find file './components/SurveyContainer' in './src'.
but the file is there...
|____src
| |____research
| | |____graphQL.test.js
| |____aws-exports.js
| |____mock
| | |____questions.json
| |____QuestionParser
| | |____questionConverter.js
| | |____QuestionParser.js
| | |____questionConverter.test.js
| | |____QuestionParser.test.js
| |____App.css
| |____index.js
| |____index.css
| |____questionFetcher
| | |____questionFetcher.js
| | |____questionFetcher.test.js
| |____components
| | |____SurveyContainer.jsx
| | |____SurveyContainer.test.jsx
| | |____Question
| | | |____Question.test.jsx
| | | |____Question.jsx
| | |____QuestionOptionButton
| | | |____QuestionOptionButton.jsx
| | | |____QuestionOptionButton.test.jsx
| | |____QuestionOptions
| | | |____QuestionOptions.jsx
| | | |____QuestionOptions.test.jsx
| |____graphql
| | |____subscriptions.js
| | |____mutations.js
| | |____schema.json
| | |____queries.js
| |____.prettierrc
| |____App.jsx
| |____serviceWorker.js
| |____setupTests.js
| |____logo.svg
| |____.eslintrc.json
| |____App.test.jsx
The build works fine from the amplify CLI - IE amplify publish
@funkfinger can you email [email protected]? We'll try and schedule 15 mins with you since we aren't sure why your build is failing.
@funkfinger reaching out again to see if this is still an issue
Hi, thanks for following up. Yes, my build is still failing. I am available
tomorrow and Thursday. I am out on vacation Friday through next Thursday.
Thanks again, Jay.
On Mon, Mar 11, 2019 at 12:13 PM Nikhil Swaminathan <
[email protected]> wrote:
@funkfinger https://github.com/funkfinger reaching out again to see if
this is still an issue—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/aws-amplify/amplify-js/issues/2727#issuecomment-471681210,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAXPIefRvBqJ7b0dwnPPTVUmltbrl7uks5vVqrbgaJpZM4bCMlG
.
--
Jay Wiggins
After a productive call with folks at Amazon, this has been resolved. The issue was with the case insensitive nature of OS X vs the case sensitive nature of the deployment environment. OS X was not updating the filename in git even though the file name was changed on the local OS X machine- OS X wasn't seeing a filename change when just the case was changing.
The solution was to change the filename case at GitHub.com. Had this not been an option, I believe I would have needed to delete the file and re-create it with the correct filename case.
Thanks Amazon! I'm looking forward to using these tools.
@funkfinger I was facing the same issue. Thanks for posting your answer, it helps!
Most helpful comment
After a productive call with folks at Amazon, this has been resolved. The issue was with the case insensitive nature of OS X vs the case sensitive nature of the deployment environment. OS X was not updating the filename in
giteven though the file name was changed on the local OS X machine- OS X wasn't seeing a filename change when just the case was changing.The solution was to change the filename case at GitHub.com. Had this not been an option, I believe I would have needed to delete the file and re-create it with the correct filename case.
Thanks Amazon! I'm looking forward to using these tools.