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

Fix "Cannot find module" for aws-crt-nodejs #522

Closed
wants to merge 1 commit into from
Closed

Conversation

ferbs
Copy link

@ferbs ferbs commented Jan 10, 2024

Description of changes:
In lib/native/bindings.js, after successfully finding the aws-crt-nodejs native module, it drops the .node extension when calling require. That should be fine in a pure commonJs environment but dropping the extension breaks some ES-like runtime and build environments.

This PR includes the extension in the require call.

I don't see a test to update. (Consider adding some? There seem to be a lot of regressions in aws-sdk-js-v3 relating to aws-crt and signature-v4-crt. It would take a lot of work around test fixtures but perhaps worthwhile/justified?)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

In lib/native/bindings.js, after successfully finding the aws-crt-nodejs native module, it drops the *.node* extension when calling require.
That should be fine in a pure commonJs environment but dropping the extension breaks some ES-like runtime and build environments.

This PR includes the extension in the require call.

I don't see a test to update. (Consider adding some? There seem to be a lot of regressions in aws-sdk-js-v3 relating to aws-crt and signature-v4-crt. It would take a lot of work around test fixtures but perhaps worthwhile/justified?)
@graebm graebm mentioned this pull request Jan 16, 2024
@bretambrose
Copy link
Contributor

Should be superceded by #490

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

Successfully merging this pull request may close these issues.

2 participants