Closed ian-s-mcb closed 5 years ago
The frontend build step on Amplify Console would fail with the following error.
# Starting phase: preBuild # Executing command: yarn install 2019-04-14T23:17:04.159Z [INFO]: yarn install v1.13.0 2019-04-14T23:17:04.271Z [WARNING]: warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json. 2019-04-14T23:17:04.276Z [INFO]: [1/4] Resolving packages... 2019-04-14T23:17:04.326Z [WARNING]: warning Resolution field "graphql@0.13.0" is incompatible with requested version "graphql@^0.13.2" 2019-04-14T23:17:04.961Z [INFO]: [2/4] Fetching packages... 2019-04-14T23:17:19.517Z [INFO]: info fsevents@1.2.4: The platform "linux" is incompatible with this module. 2019-04-14T23:17:19.518Z [INFO]: info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation. 2019-04-14T23:17:19.537Z [INFO]: [3/4] Linking dependencies... 2019-04-14T23:17:19.548Z [WARNING]: warning "gatsby > babel-plugin-remove-graphql-queries@2.0.2-beta.8" has incorrect peer dependency "graphql@^0.13.2". 2019-04-14T23:17:26.618Z [INFO]: [4/4] Building fresh packages... 2019-04-14T23:17:28.008Z [INFO]: success Saved lockfile. 2019-04-14T23:17:28.014Z [INFO]: Done in 23.86s. 2019-04-14T23:17:28.031Z [INFO]: # Completed phase: preBuild # Starting phase: build 2019-04-14T23:17:28.032Z [INFO]: # Executing command: yarn run build 2019-04-14T23:17:28.201Z [INFO]: yarn run v1.13.0 2019-04-14T23:17:28.252Z [INFO]: $ gatsby build 2019-04-14T23:17:29.952Z [INFO]: success open and validate gatsby-config — 0.006 s 2019-04-14T23:17:30.092Z [INFO]: success load plugins — 0.140 s 2019-04-14T23:17:30.240Z [INFO]: success onPreInit — 0.148 s 2019-04-14T23:17:30.246Z [INFO]: success delete html and css files from previous builds — 0.006 s 2019-04-14T23:17:30.253Z [INFO]: success initialize cache — 0.007 s 2019-04-14T23:17:30.264Z [INFO]: success copy gatsby files — 0.011 s 2019-04-14T23:17:30.265Z [INFO]: success onPreBootstrap — 0.001 s 2019-04-14T23:17:30.280Z [INFO]: success source and transform nodes — 0.016 s 2019-04-14T23:17:30.408Z [INFO]: success building schema — 0.128 s 2019-04-14T23:17:30.413Z [INFO]: success createPages — 0.004 s 2019-04-14T23:17:30.435Z [INFO]: success createPagesStatefully — 0.021 s 2019-04-14T23:17:30.435Z [INFO]: success onPreExtractQueries — 0.000 s 2019-04-14T23:17:30.503Z [INFO]: success update schema — 0.067 s 2019-04-14T23:17:30.538Z [INFO]: success extract queries from components — 0.035 s 2019-04-14T23:17:30.567Z [INFO]: success run graphql queries — 0.029 s — 6/6 215.69 queries/second 2019-04-14T23:17:30.570Z [INFO]: success write out page data — 0.003 s 2019-04-14T23:17:30.571Z [INFO]: success write out redirect data — 0.000 s 2019-04-14T23:17:30.729Z [INFO]: done generating icons for manifest 2019-04-14T23:17:30.730Z [INFO]: success onPostBootstrap — 0.159 s 2019-04-14T23:17:30.730Z [INFO]: info bootstrap finished - 2.462 s 2019-04-14T23:17:30.730Z [INFO]: 2019-04-14T23:17:32.711Z [WARNING]: Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade caniuse-lite browserslist` 2019-04-14T23:18:00.734Z [INFO]: success Building production JavaScript and CSS bundles — 30.002 s 2019-04-14T23:18:04.476Z [INFO]: 2019-04-14T23:18:04.477Z [WARNING]: error Building static HTML for pages failed See our docs page on debugging HTML builds for help https://goo.gl/yL9lND 2019-04-14T23:18:04.503Z [INFO]: 64 | 65 | if (data == null || !ClientId || !AppWebDomain || !RedirectUriSignIn || !RedirectUriSignOut) { > 66 | throw new Error(this.getCognitoConstants().PARAMETERERROR); | ^ 67 | } 68 | 69 | this.clientId = ClientId; [0m [0m [0m[97m[41mWebpackError[0m[37m[41m:[0m[37m[41m [0m[97m[41mThe parameters: App client Id, App web domain, the redirect URL [0m [0m[97m[41mwhen you are signed in and the redirect URL when you are signed out are requir[0m [0m[97m[41med.[0m [0m [0m [0m [0m[90m-[0m [0m[93mCognitoAuth.js[0m[90m:[0m[93m66[0m[37m [0m[37mnew CognitoAuth[0m [0m [0m [0m[90m[lib]/[amazon-cognito-auth-js]/es/CognitoAuth.js:66:1[0m [0m [0m [0m [0m[90m-[0m [0m[93mAuth.js[0m[90m:[0m[93m135[0m[37m [0m[37mAuthClass../node_modules/@aws-amplify/auth/lib/Auth.js.AuthClass[0m [0m [0m[37m.configure[0m [0m [0m [0m[90m[lib]/[@aws-amplify]/auth/lib/Auth.js:135:1[0m [0m [0m [0m [0m[90m-[0m [0m[93mAmplify.js[0m[90m:[0m[93m25[0m[37m [0m [0m [0m [0m[90m[lib]/[@aws-amplify]/core/lib/Amplify.js:25:1[0m [0m [0m [0m [0m [0m [0m[90m-[0m [0m[93mAmplify.js[0m[90m:[0m[93m24[0m[37m [0m[37mFunction../node_modules/@aws-amplify/core/lib/Amplify.js.Ampli[0m [0m [0m[37mfy.configure[0m [0m [0m [0m[90m[lib]/[@aws-amplify]/core/lib/Amplify.js:24:1[0m [0m [0m [0m [0m[90m-[0m [0m[93mindex.js[0m[90m:[0m[93m8[0m[37m [0m[37mModule../src/pages/index.js[0m [0m [0m [0m[90mlib/src/pages/index.js:8:9[0m [0m [0m [0m [0m[90m-[0m [0m[93mbootstrap[0m[90m:[0m[93m19[0m[37m [0m[37m__webpack_require__[0m [0m [0m [0m[90mlib/webpack/bootstrap:19:1[0m [0m [0m [0m [0m[90m-[0m [0m[93msync-requires.js[0m[90m:[0m[93m9[0m[37m [0m[37mObject../.cache/sync-requires.js[0m [0m [0m [0m[90mlib/.cache/sync-requires.js:9:51[0m [0m [0m [0m [0m[90m-[0m [0m[93mbootstrap[0m[90m:[0m[93m19[0m[37m [0m[37m__webpack_require__[0m [0m [0m [0m[90mlib/webpack/bootstrap:19:1[0m [0m [0m [0m [0m[90m-[0m [0m[93mstatic-entry.js[0m[90m:[0m[93m9[0m[37m [0m[37mModule../.cache/static-entry.js[0m [0m [0m [0m[90mlib/.cache/static-entry.js:9:22[0m [0m [0m [0m [0m[90m-[0m [0m[93mbootstrap[0m[90m:[0m[93m19[0m[37m [0m[37m__webpack_require__[0m [0m [0m [0m[90mlib/webpack/bootstrap:19:1[0m [0m [0m [0m [0m[90m-[0m [0m[93mbootstrap[0m[90m:[0m[93m83[0m[37m [0m [0m [0m [0m[90mlib/webpack/bootstrap:83:1[0m [0m [0m [0m [0m [0m [0m[90m-[0m [0m[93muniversalModuleDefinition[0m[90m:[0m[93m3[0m[37m [0m[37mwebpackUniversalModuleDefinition[0m [0m [0m [0m[90mlib/webpack/universalModuleDefinition:3:1[0m [0m [0m [0m [0m[90m-[0m [0m[93muniversalModuleDefinition[0m[90m:[0m[93m10[0m[37m [0m[37mObject.<anonymous>[0m [0m [0m [0m[90mlib/webpack/universalModuleDefinition:10:2[0m [0m [0m [0m [0m [0m 2019-04-14T23:18:04.576Z [WARNING]: error Command failed with exit code 1. 2019-04-14T23:18:04.578Z [INFO]: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 2019-04-14T23:18:04.581Z [ERROR]: !!! Build failed 2019-04-14T23:18:04.708Z [ERROR]: !!! Non-Zero Exit Code detected 2019-04-14T23:18:04.708Z [INFO]: # Starting environment caching... 2019-04-14T23:18:04.708Z [INFO]: Uploading environment cache artifact... 2019-04-14T23:18:04.754Z [INFO]: # Environment caching completed Terminating logging...
Upgrading all the yarn packages fixed the problem for me.
After you clone the repository delete the yarn.lock file.
This should work now, I've updated the repo. Thanks for the issue!
The frontend build step on Amplify Console would fail with the following error.