Amplify-js: aws-amplify@^0.1.36 undefined is not a function (near ...window.addEventListener...)

Created on 26 Aug 2018  路  4Comments  路  Source: aws-amplify/amplify-js

Related Issue

#230

Do you want to request a feature or report a bug?

  • report a bug and
  • request a feature

What is the current behavior?

  • If do not turn on debugger

undefined is not a function (near ...window.addEventListener...)

  • If turn on debugger

Worked well.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than AWS Amplify.

  1. npm install
  npm install --save aws-amplify  // This line installed "^0.1.36" in my case.
  npm install --save aws-amplify-react
  npm install --save aws-amplify-react-native
  1. import and used
  import Amplify, { Auth } from "aws-amplify";
  import aws_exports from "../aws-exports";  
  import authConfigure from "../authConfigure";
  Amplify.configure(aws_exports);
  Auth.configure(authConfigure);

  Auth.federatedSignin()

This issue can be resolved

npm install --save aws-amplify@latest

But This issue will cause many people to confuse how to add amplify.

What is the expected behavior?

  • AWS amplify should work regardless of if debugger turns on.
  • This issue should be wrote in docs.

    • Want to change document like this

      npm install --save aws-amplify@(version that rightly work)

Auth bug investigating

Most helpful comment

May be unrelated to this problem, looks like the new @aws-amplify/predictions dependency is creating similar problems. Just install aws modules one by one to only get the one you'll use.

All 4 comments

@7772 I am going to close this issue as this is out of date. If you still have this issue in the latest version of amplify please reopen it.

I have pretty much the same problem. Debugged remotely it works well, without remote debugging, "undefined is not a function(evaluation 'Uint32Array.from')" is displayed. aws-amplify aws-amplify-react and aws-amplify-react-native are all up to date. I'm sure it's from amplify since there's AmazonAIConvertPredictionsProvider.js mentionned in the error

May be unrelated to this problem, looks like the new @aws-amplify/predictions dependency is creating similar problems. Just install aws modules one by one to only get the one you'll use.

I'm running into Uint32Array.from not being defined on IE11 when using a AppSync api. I've traced it to this line: https://github.com/aws/aws-sdk-js-crypto-helpers/blob/master/packages/sha256-js/src/RawSha256.ts#L13

I'm investigating wheter I can polyfill it or configure amplify-js differently to not use this code.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

romainquellec picture romainquellec  路  3Comments

guanzo picture guanzo  路  3Comments

simon998yang picture simon998yang  路  3Comments

leantide picture leantide  路  3Comments

cgarvis picture cgarvis  路  3Comments