amplify-js: undefined is not an object (evaluating 'window.location.href')

Describe the bug I updated react-native from 0.61.4 to 0.61.5 and I got warning

WARN  Possible Unhandled Promise Rejection (id: 0):
TypeError: undefined is not an object (evaluating 'window.location.href')
http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:167369:89
step@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:165674:25

It’s warning arise when i run next code

import Amplify, { Auth } from 'aws-amplify';
import API, {graphqlOperation} from "@aws-amplify/api";
import awsconfig from './../aws-exports';
Amplify.configure(awsconfig); // when i disable this row, warning disappear

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 16 (4 by maintainers)

Most upvoted comments

@bitcrumb Awesome! We’ll get this released!

(Closing since #4803 resolves this)

@lexwebb Hmm, this seems to be released.

Screen Shot 2020-02-24 at 1 52 24 PMhttps://codesandbox.io/s/amplify-jsissues4708-m93x1

And the new code appears here:

https://unpkg.com/browse/@aws-amplify/core@2.2.4/lib-esm/index.js

Within your project, you can confirm what version of @aws-amplify/core you’re running via:

$ node
> require('@aws-amplify/core/package.json').version
'2.2.4'

@manueliglesias Do you believe https://github.com/aws-amplify/amplify-js/pull/4803 may address this? If so, we can queue it for release 🤞