Describe the bug
Frontend build doesn't work anymore. I think that maybe it has to do with changing from npm to yarn. Removing yarn.lock and switching back to npm does not seem to help though.
# Starting phase: build
# Executing command: amplifyPush --simple
2020-06-11T09:17:18.746Z [INFO]:
2020-06-11T09:17:18.747Z [INFO]: For more information on AWS Profiles, see:
https://docs.aws.amazon.com/cli/latest/userguide/cli-multiple-profiles.html
2020-06-11T09:17:18.996Z [INFO]: Amplify AppID found: xxxxxxxxxx. Amplify App name is: gv
2020-06-11T09:17:19.083Z [INFO]: Backend environment staging found in Amplify Console app: gv
2020-06-11T09:17:19.704Z [INFO]:
2020-06-11T09:17:20.402Z [INFO]: Note: It is recommended to run this command from the root of your app directory
2020-06-11T09:17:23.778Z [WARNING]: - Initializing your environment: staging
2020-06-11T09:17:24.447Z [WARNING]: ✔ Initialized provider successfully.
2020-06-11T09:17:29.114Z [WARNING]: ✖ An error occurred when pushing the resources to the cloud
2020-06-11T09:17:29.115Z [WARNING]: ✖ There was an error initializing your environment.
2020-06-11T09:17:29.116Z [INFO]: init failed
2020-06-11T09:17:29.117Z [INFO]: TypeError: Cannot read property 'join' of null
at runPackageManager (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-nodejs-function-runtime-provider/lib/utils/legacyBuild.js:53:51)
at installDependencies (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-nodejs-function-runtime-provider/lib/utils/legacyBuild.js:38:5)
at Object.buildResource (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-nodejs-function-runtime-provider/lib/utils/legacyBuild.js:14:9)
at Object.build (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-nodejs-function-runtime-provider/lib/index.js:29:40)
at buildResource (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/lib/build-resources.js:47:36)
at process._tickCallback (internal/process/next_tick.js:68:7)
2020-06-11T09:17:29.131Z [ERROR]: !!! Build failed
2020-06-11T09:17:29.185Z [ERROR]: !!! Non-Zero Exit Code detected
2020-06-11T09:17:29.185Z [INFO]: # Starting environment caching...
2020-06-11T09:17:29.186Z [INFO]: # Environment caching completed
To Reproduce
Unfortunately I am not sure how to guide you to reproduce. Should I try to create another branch / env ?
Expected behavior
Build successfully, like it did before :)
@edlefebvre seems like the error you're facing is in the backend step of the build settings. we are investigating.
Hello @edlefebvre
Could you send over the project you are using to [email protected] ? We'd like to see if we can reproduce this build error locally.
Hi @SwaySway , I'm afraid I'm not authorized to do that. Is there anything I can do on my hand to help debug this? Or where can I find additional logs?
Thank you
Well, I disconnected the branch, made a bunch of changes (that has nothing to do with the issue), reconnect the branch to test again and it works now... Hope I don't see this again, closing for now :)
Hi @SwaySway
I'm having this exact problem. Mine is just a personal project, so I can send you details over if they would help. What details would you need?
I'm seeing this too. I know the issue closed because it went away for the original poster, but does anyone else have insight?
Hi @jmosul
The build error in the logs looked like a build error in functions. I tried to reproduce this with a change in between versions but I was not able to reproduce. If you have steps to reproduce this or send over your project I can dive into this issue.
same issue here. Tried a few things but struggled to find why the console build failed whilst CLI push worked fine.
I got to the bottom of it, when I created a new git branch whilst trying to figure out what was going on. When I switched back to the main branch, I could see using amplify status that the CLI was listing a create operation for a function which I did not recognise.
The function folder was empty and only had an amplify.state file. I removed the folder using amplify remove [function name] and then did the usual git commit/push to trigger console deployment and pipeline worked again.
In the pipeline, I no longer got the dreaded TypeError: Cannot read property 'join' of null error and then I could finally see the actual error (also present in the CloudFormation Console). For me the error was a CloudFormation file missing a parameter causing the deployment to fail.
I added the parameter and git pushed again, and all was good and green again in the amplify console at least.
My guess is a broken CFn template combined with a removed function caused the console environment to be cached in a broken state.
@SwaySway
Sorry for the delay, I've not had chance to work on my project over the last few weeks.
I've sent the link to my repo and the AWS Amplify project information to the [email protected] email address supplied above. Hope it helps.
For context in the project the master branch contains version 1. The branches production and 2.0 contain version 2.
V2 is a completely new Amplify project, but was started by locally updating Amplify and related packages in v1 through npm.
Thanks for looking into this.
Worked out my issue.
Turns out I had amplify/backend files missing from my branch.
Me too. Such a spaghettis flow. I love Italian food but like this, not at work. Having to redo my project for the 5th or 6th time. Every time its a different reason" bug, reconnect to git issues, versions, old cli, unfound variables (facebook/google), rewrite redirect specially on pwa, No support/documentation for SSR except next but not nuxt. I hoped going serverless might save me time but I see that every deploy is like unprotected intercourse with a prostitute.
2020-11-06T00:05:07.319Z [INFO]: # Initializing new Amplify environment: pwa (amplify init)
2020-11-06T00:05:10.322Z [WARNING]: /root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/gluegun/build/index.js:13
throw up;
^
SyntaxError: Unexpected token in JSON at position 57
at JSON.parse (<anonymous>)
at normalizeValue (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/src/lib/input-params-manager.js:29:32)
at Object.keys.forEach (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/src/lib/input-params-manager.js:5:29)
at Array.forEach (<anonymous>)
at normalizeInputParams (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/src/lib/input-params-manager.js:3:43)
at constructExeInfo (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/src/commands/init.js:22:18)
at Command.run (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/src/commands/init.js:11:5)
at Runtime.<anonymous> (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/gluegun/build/runtime/run.js:117:58)
at step (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/gluegun/build/runtime/run.js:43:23)
at Object.next (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/gluegun/build/runtime/run.js:24:53)
at fulfilled (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/gluegun/build/runtime/run.js:15:58)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:832:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
2020-11-06T00:05:10.331Z [ERROR]: !!! Build failed
2020-11-06T00:05:10.331Z [ERROR]: !!! Non-Zero Exit Code detected
2020-11-06T00:05:10.331Z [INFO]: # Starting environment caching...
2020-11-06T00:05:10.331Z [INFO]: # Environment caching completed
Terminating logging...
For me it seems a problem in autogenerated schema file in build folder. I deleted auto generated schema file and recompiled using amplify api gql-compile pushed the changes again and that problem gone. That file was modified by a team members to add comments in it.