Amplify-js: S3 is not a constructor & Observable is not a constructor ERRORS

Created on 25 Oct 2019  路  12Comments  路  Source: aws-amplify/amplify-js

Problem:

I was using Storage and subscription well on React Native, but now it doesn't work with same codes. It rejects with

_S3 is not a constructor_

for Storage,

_Observable is not a constructor_

for Subscription (Queries and mutations working well.)

Packages:

  "react": "16.9.0",
  "react-native": "0.61.2",
  "amazon-cognito-identity-js": "3.1.3",
  "aws-amplify": "1.2.3",
  "aws-amplify-react-native": "2.2.3",

Codes:

import awsconfig from './aws-exports';
import Amplify, {Storage} from 'aws-amplify';

Amplify.configure(awsconfig);

export const ImageDownloader = fileName => {
  return Storage.get(fileName, {track: true});
};
React Native bug

Most helpful comment

The fix has reached into a stable release. @adamsythe, github automatically closes the issue when tagged with fixes directive, and our master commits go to unstable release (automatically) but not to stable releases

All 12 comments

Same error for me "Object is not a constructor (evaluating 'new S3')"

same error @aws-amplify/storage.. v1.2.2 is fine.

@orcunorcun @Nitheesh-u @rarira I pushed a quick fix for that which is now published to unstable, can you please test it with this version(unstable tag) and let us know if that solved this issue?

@Amplifiyer well, I've changed the version with unstable tag:
"aws-amplify": "^1.2.3-unstable.0"

And then new warning has occured:
[Unhandled promise rejection: Error: No credentials, applicationId or region]

So, I disable Analytics like this:
Amplify.configure({ Analytics: { disabled: true } })

And it works for both S3 and Subscriptions after changed to unstable version, thanks!

Edit:
No Auth module registered in Amplify has appeared when I'm trying to publish MQTT message using PubSub from aws-amplify

why is this closed?

@adamsythe I don't know why, but I'm still waiting for update. My application can't subscribe using aws-amplify with unstable version

@itsgitz @adamsythe, can you please post your error messages and code samples here that is causing the issue? Please also verify the unstable version of aws-amplify packages you are consuming in the node_modules folder.

@Amplifiyer for now, there's no problem with S3 but I got this error/warning messages while publishing, the message using MQTT:
ss

And this is my sample codes:

import { PubSub } from 'aws-amplify'

PubSub.publish(topic, {
    command: 'open',
});

I'm using "aws-amplify": "^1.2.4-unstable.5".

Thank you :)

^1.2.4-unstable.5 seems to be working from me but surely this should stay live at least until the fix goes into an official release?

The fix has reached into a stable release. @adamsythe, github automatically closes the issue when tagged with fixes directive, and our master commits go to unstable release (automatically) but not to stable releases

@Amplifiyer thanks! It solved with latest stable version "aws-amplify": "^1.2.4"

Resolving as the release was completed yesterday as @Amplifiyer called out. Please feel free to reopen if you are still experiencing this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DougWoodCDS picture DougWoodCDS  路  3Comments

callmekatootie picture callmekatootie  路  3Comments

romainquellec picture romainquellec  路  3Comments

benevolentprof picture benevolentprof  路  3Comments

oste picture oste  路  3Comments