dabit3 / gatsby-auth-starter-aws-amplify

Starter Project with Authentication with Gatsby & AWS Amplify
MIT License
324 stars 399 forks source link

Amplify Console build error #14

Closed ian-s-mcb closed 5 years ago

ian-s-mcb commented 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;

  WebpackError: The parameters: App client Id, App web domain, the redirect URL   when you are signed in and the redirect URL when you are signed out are requir  ed.
  
  - CognitoAuth.js:66 new CognitoAuth
    [lib]/[amazon-cognito-auth-js]/es/CognitoAuth.js:66:1
  
  - Auth.js:135 AuthClass../node_modules/@aws-amplify/auth/lib/Auth.js.AuthClass    .configure
    [lib]/[@aws-amplify]/auth/lib/Auth.js:135:1
  
  - Amplify.js:25 
    [lib]/[@aws-amplify]/core/lib/Amplify.js:25:1
  
  
  - Amplify.js:24 Function../node_modules/@aws-amplify/core/lib/Amplify.js.Ampli    fy.configure
    [lib]/[@aws-amplify]/core/lib/Amplify.js:24:1
  
  - index.js:8 Module../src/pages/index.js
    lib/src/pages/index.js:8:9
  
  - bootstrap:19 __webpack_require__
    lib/webpack/bootstrap:19:1
  
  - sync-requires.js:9 Object../.cache/sync-requires.js
    lib/.cache/sync-requires.js:9:51
  
  - bootstrap:19 __webpack_require__
    lib/webpack/bootstrap:19:1
  
  - static-entry.js:9 Module../.cache/static-entry.js
    lib/.cache/static-entry.js:9:22
  
  - bootstrap:19 __webpack_require__
    lib/webpack/bootstrap:19:1
  
  - bootstrap:83 
    lib/webpack/bootstrap:83:1
  
  
  - universalModuleDefinition:3 webpackUniversalModuleDefinition
    lib/webpack/universalModuleDefinition:3:1
  
  - universalModuleDefinition:10 Object.<anonymous>
    lib/webpack/universalModuleDefinition:10:2
  
  

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...
ian-s-mcb commented 5 years ago

Upgrading all the yarn packages fixed the problem for me.

timhibberd commented 5 years ago

After you clone the repository delete the yarn.lock file.

dabit3 commented 5 years ago

This should work now, I've updated the repo. Thanks for the issue!