Skip to content
This repository has been archived by the owner on Feb 24, 2018. It is now read-only.

Uncaught TypeError: Cannot set property 'createCredentials' of undefined #679

Open
PrashanthThugaiah opened this issue Feb 8, 2018 · 2 comments

Comments

@PrashanthThugaiah
Copy link

Hi Team,
I am using this module(amazon-cognito-identity-js) for my react project(with webpack), This module is creating issue in the production build.

The error is:

Uncaught TypeError: Cannot set property 'createCredentials' of undefined

at index.js:94

cognito-sdk-issue

at index.js:95
at Object../node_modules/aws-sdk/node_modules/crypto-browserify/index.js (index.js:81)
at f (bootstrap 078132641668547bb385:678)
at n (bootstrap 078132641668547bb385:88)
at Object.<anonymous> (browser_loader.js:4)
at Object../node_modules/aws-sdk/lib/browser_loader.js (index.bundle.js:4966)
at f (bootstrap 078132641668547bb385:678)
at n (bootstrap 078132641668547bb385:88)
at Object../node_modules/aws-sdk/browser.js (browser.js:1)

Note:

  1. I am not facing any issues at dev environment.
  2. I tested excluding this module from the code base, The build is build is working fine.

Please revert to this issue ASAP on priority.
Thank You
Best Regards,
Prashanth Thugaiah

@phstc
Copy link

phstc commented Feb 8, 2018

@PrashanthThugaiah I'm also facing the same issue, I will let you know if I figured out the problem.

@PrashanthThugaiah
Copy link
Author

Hi,
I have a temporary fix to this issue.(but, This might cause side effects)

Need to make changes in file: node_modules\aws-sdk\node_modules\crypto-browserify\index.js

changes: comment the following code snippet in the above mentioned file.

each(['createCredentials'
, 'createCipher'
, 'createCipheriv'
, 'createDecipher'
, 'createDecipheriv'
, 'createSign'
, 'createVerify'
, 'createDiffieHellman'
, 'pbkdf2'], function (name) {
  exports[name] = function () {
    error('sorry,', name, 'is not implemented yet')
  }
})

I am working to find permanent fix to this issue.
Any help will be appreciated.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants