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

AWS-SDK 2.6.1 breaks mock-aws #4

Open
yoitsro opened this issue Sep 12, 2016 · 9 comments
Open

AWS-SDK 2.6.1 breaks mock-aws #4

yoitsro opened this issue Sep 12, 2016 · 9 comments

Comments

@yoitsro
Copy link

yoitsro commented Sep 12, 2016

The AWS SDK has changed the way it loads its services. It now employs a lazy loading way, whereby services are loaded when they're first needed: aws/aws-sdk-js@39a1783

As a result, this breaks mock-aws.

@pedrocarrico
Copy link

@yoitsro Is TypeError: Attempted to wrap undefined property STS as function what you're getting?

Seeing something similar on one of my projects.

@yoitsro
Copy link
Author

yoitsro commented Sep 15, 2016

Hey @pedrocarrico, yeah it is.

@hairyhenderson
Copy link

This is happening to me too... 😞

/cc @antonosmond

@antonosmond
Copy link
Owner

I'll try and look at this at the weekend

@hairyhenderson
Copy link

Thanks @antonosmond!

Something really strange I saw last night when digging into this was that if I cloned the repo and npm lned it into my project, I got errors, but not the TypeError. When I npm unlinked the local dep and just npm installed it, I got the TypeError. From what I could tell there were no differences in the module on-disk or from npmjs. There were some differences in sub-dependencies, but I'm not really sure how any of those would've made an impact.

For reference, here's the stack I'm seeing:

TypeError: Attempted to wrap undefined property STS as function
    at checkWrappedMethod (/myrepo/node_modules/sinon/lib/sinon/util/core.js:76:29)
    at Object.wrapMethod (/myrepo/node_modules/sinon/lib/sinon/util/core.js:120:21)
    at Object.stub (/myrepo/node_modules/sinon/lib/sinon/stub.js:60:26)
    at createStub (/myrepo/node_modules/mock-aws/lib/mock-aws.js:17:9)
    at Object.<anonymous> (/myrepo/node_modules/mock-aws/lib/mock-aws.js:12:5)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/myrepo/test/foo_test.js:5:11)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at /Users/dee/.nvm/versions/node/v6.7.0/lib/node_modules/mocha/lib/mocha.js:219:27
    at Array.forEach (native)
    at Mocha.loadFiles (/Users/dee/.nvm/versions/node/v6.7.0/lib/node_modules/mocha/lib/mocha.js:216:14)
    at Mocha.run (/Users/dee/.nvm/versions/node/v6.7.0/lib/node_modules/mocha/lib/mocha.js:468:10)
    at loadAndRun (/Users/dee/.nvm/versions/node/v6.7.0/lib/node_modules/mocha/bin/_mocha:359:22)
    at Object.<anonymous> (/Users/dee/.nvm/versions/node/v6.7.0/lib/node_modules/mocha/bin/_mocha:376:3)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.runMain (module.js:590:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3

@antonosmond
Copy link
Owner

To be honest I think this is going to need a complete re-write if what @yoitsro said is true.
I'll have a look at the weekend and see what I can do.

@hairyhenderson
Copy link

😞 - thanks anyway @antonosmond !

@hairyhenderson
Copy link

I've noticed that aws-sdk 2.6.4 and above seem to be working fine with mock-aws now... Maybe there's no fix necessary now?

@simoneb
Copy link

simoneb commented Dec 22, 2016

doesn't seem to work with 2.7.16

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

5 participants