Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on production when using aws-sdk #5

Closed
jonathanmv opened this issue Jun 3, 2017 · 14 comments
Closed

Error on production when using aws-sdk #5

jonathanmv opened this issue Jun 3, 2017 · 14 comments

Comments

@jonathanmv
Copy link

First of all, thank you very much for sharing this boilerplate. It's great

I just confirmed by cloning a fresh copy of this repo and only installing aws-sdk that npm run serve-prod will throw an error: TypeError: Cannot set property 'createCredentials' of undefined

I've been able to track it down to the crypo package (crypto-browserify@1.0.9) that aws-sdk uses as a dependency, but I haven't been able to solve it just yet.

I'm creating this issue so that other people know about this block and how to solve it (when solved...)

@MacKentoch
Copy link
Owner

I'm sorry I don't know about aws-sdk.

@MacKentoch
Copy link
Owner

Isn't it due to global variable?

Feel free to share your experience with AWS.

I never say no to new information

@jonathanmv
Copy link
Author

Not sure if it has something to do with a global variable. I haven't tried to find what the issue is yet, I haven't taken the time to do it, sorry.

I'll share the solution if I find it, but to be honest I won't be working on it for now.

@MacKentoch
Copy link
Owner

I stay tuned.

If I have to use AWS before (not planned right now) I will give a feedback.

@Enase
Copy link

Enase commented Sep 18, 2017

Hi guys,

I've had totally the same trouble, so now I can share with u details.
The reason is UglifyJsPlugin. Try to disable the plugin or setup it in a way to skip/exclude aws sdk.

@MacKentoch
Copy link
Owner

@Enase thank you for taking time sharing.

@MacKentoch
Copy link
Owner

By the way, does still occurred with latest version?

I remember I removed UglifyJs from webpack configs.

@cskeppstedt
Copy link

Just wanted to say that I'm seeing this problem in our project (which is not related to react-redux-bootstrap-webpack-starter – we have a different webpack config all together). We're also seeing that the issue is solved by removing the UglifyJS plugin. Not uglifying the build is not really an option though, so we're trying to figure out a way to put all the AWS stuff in a separate bundle and then exclude that bundle from being uglified instead.

@MacKentoch
Copy link
Owner

Thank you @cskeppstedt for sharing your experience 👍 +1

So I close this issue and I'm sorry not to have solutions to offer.

@ihle
Copy link

ihle commented Oct 9, 2017

For what it's worth, I managed to work around the issue in UglifyJS by excluding variables called "exports" from the mangler, e.g. mangle: { except: ['exports'] }

@prateekro
Copy link

@Enase What did you do to skip/exclude aws sdk to let go off this error?

@asharafshahi
Copy link

I tried the suggestion of using the mangle: { except: ['exports'] } but it did not solve this issue. How would one confirm that the right things happened? Any other suggestion for how to work around this... such as how to exclude the aws sdk? -thx

@Enase
Copy link

Enase commented Feb 7, 2018

@prateekro Unfortunately I cannot reproduce the issue with the latest libraries, so that I cannot share or copy/paste the solution. Could you/someone share a code sample affected or steps to reproduce?

@janhoeck
Copy link

I have to same problem in all my project, where I am using the UglifyPlugin and the aws-sdk.
After removing the aws-sdk, all works fine.

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

No branches or pull requests

8 participants