question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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)
      

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
PyrrhaDevcommented, Aug 9, 2019

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.

2reactions
PyrrhaDevcommented, Aug 9, 2019

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

undefined is not a function (near ...window.addEventListener...)
The error claims to be coming from within browser.js and whenever I comment out importing aws-amplify the error is gone and my app...
Read more >
Javascript event listener fails because "undefined" is not a ...
$('#tagBox') returns a jQuery element which doesn't have addEventListener method which is a native method. You need to get the raw DOM ...
Read more >
TypeError: addEventListener is not a function in JavaScript
The "addEventListener is not a function" error occurs for multiple reasons: calling the method on an object that is not a valid DOM...
Read more >
Window.postMessage() - Web APIs | MDN
The window.postMessage() method safely enables cross-origin communication between Window objects; e.g., between a page and a pop-up that it ...
Read more >
Why am I getting Error message: addEventListener is not a ...
Hello, I am adding an addEventListener function to a (video) DIV so that when people click on the Thumbnail of the Video, it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found