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

Cannot find module 'aws-xray-sdk-core/lib/middleware/sampling/service_connector' from 'node_modules/aws-xray-sdk-express/lib/express_mw.js' #427

Closed
ls-jacob-lawrence opened this issue May 13, 2021 · 8 comments
Assignees
Labels

Comments

@ls-jacob-lawrence
Copy link

ls-jacob-lawrence commented May 13, 2021

Cannot find module 'aws-xray-sdk-core/lib/middleware/sampling/service_connector' from 'node_modules/aws-xray-sdk-express/lib/express_mw.js'

Version 3.3.2 introduces this bug due to 84e65c3

The absolute path is missing the /dist/ for consumers

@chuck-park
Copy link

chuck-park commented May 13, 2021

My team also had an issue derived from the new /dist/ path behind the /lib/ because I directed accessed to aws-xray-sdk-core/lib/context_utils on my project. so I got Cannot find module error. I temporarily solved this issue by fixing aws-xray-sdk-core version to downgraded one("aws-xray-sdk-core": "^3.1.0" -> "aws-xray-sdk-core": "3.3.1" on package.json).

@padzikm
Copy link

padzikm commented May 13, 2021

We have the same problem with error Runtime.ImportModuleError: Error: Cannot find module 'aws-xray-sdk-core/lib/middleware/sampling/service_connector' - version 3.2.0 all packages aws-xray-sdk-*

@willarmiros
Copy link
Contributor

Hello,

Thanks for raising this issue. We'll get a patch out ASAP to address it.

@willarmiros
Copy link
Contributor

willarmiros commented May 13, 2021

@ChungminPark we intend on keeping the new structure with dist in the path. All of the public APIs in the context_utils module are exposed via the top-level AWSXRay object, e.g. AWSXRay.setSegment(), and I would recommend referencing them like that so you aren't dependent on the directory structure.

The reference that caused this crash should not have been an absolute path to begin with - that was a mistake in the original change linked in this issue.

@GregTurner
Copy link

GregTurner commented May 13, 2021

Can we get a npm publish please? (nevermind I see one in-progress now)

@willarmiros
Copy link
Contributor

@GregTurner preparing the release right now.

@willarmiros
Copy link
Contributor

This issue is fixed in v3.3.3, available now on NPM. Please let us know if there are any further issues. Apologies again for the trouble.

@chuck-park
Copy link

@willarmiros Thanks a lot!

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

No branches or pull requests

5 participants