Quantcast
Channel: 懒得折腾
Viewing all articles
Browse latest Browse all 764

AWS Amplify + Angular 6

$
0
0

Found this while having the same/similar issues implementing awsmobile-cli and aws-amplify with angular5. Was receiving many webpack errors, followed the solutions in this order which solved my problem:

  1. In tsconfig.json added: “allowJs”: true in the “compilerOptions”
  2. npm installed stream
  3. In tsconfig.app.json added “node” to “types” array in “compilerOptions”
    Webpack compiled successfully!
    Thank you very much for the solutions 100 1st_place_medal +1

 

Ok, after an hour I finally managed to have cognito working on my Angular app (just after upgrading to 6.0).

About the message global is not defined (or something close can’t remember). Add the following into index.html:

<!doctype html>
<html lang="en">
<head>
  ...

  
    var global = global || window;
  
</head>

Then, you’ll probably get an error saying that Buffer is not defined.

Install the buffer package using npm or yarn. And add the following into polyfills.ts ():

global.Buffer = global.Buffer || require('buffer').Buffer;

Stackoverflow answers/github issues that helped me in case it’s not fixed for you after that:

Upgrading to angular-6.x gives “Uncaught ReferenceError: global is not defined”

https://github.com/aws/aws-amplify/issues/840#issuecomment-389459988

https://github.com/aws/aws-amplify/issues/678

https://github.com/aws/aws-amplify/issues/153

https://github.com/crypto-browserify/createHash/issues/20


Viewing all articles
Browse latest Browse all 764

Trending Articles