I am getting the following exception after upgrading to v1.1.5
Unable to import module 'index': Error
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/var/task/node_modules/aws-xray-sdk-core/lib/context_utils.js:5:11)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
Seriously. you have to unpublish this version
i'm not even sure you guys understood the impact of change dependency to peerDependency
missing continuation-local-storage causing a lot of problems all over the place.
npm itself doesn't have any simple way to check peerDependency has been fulfilled or not. it might be shown as "warning". but npm install won't even fail. so CI / CD thing would never break, though whole system would failed just like above on lambda.
even with knowing that, this should be at least "Major" release, not "patch" this gonna break all the clients that using "'aws-xray-sdk-core': '^1.1.x'"
i've already experiences major production outage with this, i really strongly ask you guys to understand how much of impact opensource libraries can make when it managed with careless attitude here.
this could become a production problem for anyone using xray who deploys an app right now, Support is going to be overwhelmed with this one if its not fixed soon
@kazimanzurrashid @breath103 the X-Ray team is actively investigating this issue
@kazimanzurrashid @breath103 @camwes can you confirm where this is occurring (e.g. EC2, ECS, Lambda, etc.) and with which version of NPM?
It it's occurring in elastic beanstalk for me
@abhiksingh Let me clear out this
1) from npm >= 3 npm install doesn't install peerDependencies.
2) So if you made artifact such as
dst.zip
-- app.js
-- node_modules
-- ext..
-- package.json
node_modules won't include "continuation-local-storage" even if you do npm install. it shows warnings on npm install, but it doesn't fail (npm ls would raise error, but which most of people doesn't do obviously)
3) So if there is any code const xray = require("aws-xray-sdk") in app.js, it failed like @kazimanzurrashid mentioned,

and if you do this locally,

show proper error. i guess this is also problem (that if lambda fails to import, it doesn't show raw error)
And most of case you won't even know this on test environment since aws-xray-sdk raise error if you execute any of methods in the local eviroment where there is no XRAY_AGENT is available. so usually people disable xray itself on test environment.
shortly. just quickly upload new version(1.1.6) with removing peer dependencies, otherwise there is no way to fix this unless you force every single clients to change there CI / CD scripts.
The install has a peer dependency warning on the missing module but npm assumes the install went well.
@breath103 thanks for the details. We are working on pushing out a new version (1.1.6) with the fix.
An updated version (1.1.6) has been published to NPM. This should resolve the issue. We will close this issue if we don’t receive any further updates in the next 24 hours.
@abhiksingh Checked the new version. thanks
for anyone having problems with this, i recommend to do npm ls before make deployment package from now on. which will raise error if there is any unmet peer dependencies.
As an aside, I notice that the package.json doesn't have a version – and is also marked as private: https://github.com/aws/aws-xray-sdk-node/blob/ec5bbcd0a1355a034f46dcedb839d13dfc031345/package.json
Edit: my bad, I see the sdk is actually under https://github.com/aws/aws-xray-sdk-node/blob/master/packages/full_sdk/package.json
Closing as 1.1.6 released and no further issues reported.
Most helpful comment
@abhiksingh Checked the new version. thanks
for anyone having problems with this, i recommend to do
npm lsbefore make deployment package from now on. which will raise error if there is any unmet peer dependencies.