Comments (8)
Additional context, we are running this in node
v16.6.1
. Perhaps the require is failing in the latest versions of node.js?also to @lukasa1993's point, we are using the
@aws-sdk/client-s3
lib"@aws-amplify/auth": "^4.3.2", "@aws-sdk/client-s3": "^3.11.0",
i am using node 14 so its just lib is bad i downgraded to strict "3.24" instead of ^ and probably will never upgrade this lib it seems everything aws is just faulty and pre-alpha version
from aws-crt-nodejs.
I've tried to fix this with patch-package
but no luck yet.
It turns out next.js
build process runs from a .next
cwd and this is causing the file here to not resolve.
After I fix the path to point to node_modules/aws-crt/dist/bin/darwin-x64/aws-crt-nodejs.node
the build still failed with an error:
Error: Cannot find module '/xyz/clients/src/app/node_modules/aws-crt/dist/bin/darwin-x64/aws-crt-nodejs.node'
// Also fails without .node
Error: Cannot find module '/xyz/clients/src/app/node_modules/aws-crt/dist/bin/darwin-x64/aws-crt-nodejs'
The /xyz/clients/src/app/node_modules/aws-crt/dist/bin/darwin-x64/aws-crt-nodejs.node
file exists at this path. So I'm not quite sure why this require call is failing.
Is it possible that something is corrupted in how the postinstall scripts/install.js
script runs?
Currently blocked on this issue and am trying to figure out a way to disable or mock out the missing require (as our code doesn't use this, at least not to my knowledge.)
from aws-crt-nodejs.
Found another thread where folks are also experiencing the "not found" issue aws/aws-sdk-js-v3#2750 (comment)
from aws-crt-nodejs.
aws-crt-nodejs is primarily a native addon (with a parallel browser implementation based on mqtt-js and other pure js libraries). The package that gets published to npm contains binaries for OsX, 32 and 64 bit Windows, x64 linux and armv8 linux.
from aws-crt-nodejs.
Hey @bretambrose thanks for the context.
It appears that the module resolution is failing in
aws-crt-nodejs/lib/native/binding.js
Line 46 in d751ed6
yarn
and pnpm
hoist their modules to the root directory of a project. So the binding isn't in the local child node_modules folder.
We aren't using MQTT or anything that relies on this (to my knowledge). Our application uses cognito + s3 parts of the AWS SDK.
Is there any way to disable this warning?
from aws-crt-nodejs.
this issue happens with @aws-sdk/client-s3 and NPM
2021-09-04T08:42:03.897267170Z Error: Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /opt/app/node_modules/aws-crt/dist/bin/linux-x64/aws-crt-nodejs.node)
2021-09-04T08:42:03.897272311Z at Object.Module._extensions..node (internal/modules/cjs/loader.js:1122:18)
2021-09-04T08:42:03.897276232Z at Module.load (internal/modules/cjs/loader.js:928:32)
2021-09-04T08:42:03.897280106Z at Function.Module._load (internal/modules/cjs/loader.js:769:14)
2021-09-04T08:42:03.897282394Z at Module.require (internal/modules/cjs/loader.js:952:19)
2021-09-04T08:42:03.897284594Z at require (internal/modules/cjs/helpers.js:88:18)
2021-09-04T08:42:03.897287403Z at Object.<anonymous> (/opt/app/node_modules/aws-crt/dist/native/binding.js:55:19)
2021-09-04T08:42:03.897291584Z at Module._compile (internal/modules/cjs/loader.js:1063:30)
2021-09-04T08:42:03.897295247Z at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
2021-09-04T08:42:03.897305734Z at Module.load (internal/modules/cjs/loader.js:928:32)
2021-09-04T08:42:03.897317056Z at Function.Module._load (internal/modules/cjs/loader.js:769:14)
with these dependencies:
"dependencies": {
"@aws-sdk/client-s3": "^3.16.0",
"@aws-sdk/s3-presigned-post": "^3.16.0",
"@aws-sdk/s3-request-presigner": "^3.16.0",
from aws-crt-nodejs.
Additional context, we are running this in node v16.6.1
. Perhaps the require is failing in the latest versions of node.js?
also to @lukasa1993's point, we are using the @aws-sdk/client-s3
lib
"@aws-amplify/auth": "^4.3.2",
"@aws-sdk/client-s3": "^3.11.0",
from aws-crt-nodejs.
A while back, I remember trying pnpm with a CRT-based app and not being able to reproduce this issue. I tried again recently and had no luck either. The issue may still be present but I don't think it's just pnpm alone. I feel like there's additional project setup/config (bundling/stripping/packing etc...) needed at a minimum.
Closing for now, but am happy to look again at it should explicit repro be found.
from aws-crt-nodejs.
Related Issues (20)
- Lambda@Edge SigV4Asymmetric signing issue in Typescript for S3 Multi Region Access point MRAP HOT 4
- MqttConnection should refresh STS credentials for WSS connections on reconnect
- aws-crt mqtt library not working with Webpack 5 HOT 1
- Node and Browser versions of the `iot.AwsIotMqttConnectionConfigBuilder` do not provide the same API HOT 8
- Buffer constructor is deprecated (node) HOT 1
- Migrate browser samples to use aws-sdk v3
- Webpack build warning HOT 4
- Segmentation Fault immediately on require inside Worker threads on Linux HOT 6
- Improve error messages that are returned when an exception is thrown while attempting to subscribe in JS HOT 1
- upgrade axios to 1.x HOT 6
- Add Esbuild support HOT 15
- 'AWS Signer SigV4A Headers' unit test failing HOT 9
- yarn install for aws-crt-nodejs: CMake Error: CMAKE_C_COMPILER not set HOT 11
- Node binaries not loading from binding.js when hoisted to root of node_modules HOT 6
- IoT unsigned custom authentication builder broken HOT 10
- Support `aws-c-s3` HOT 1
- Default provider chain does not support SSO profile-defined credentials HOT 2
- upgrade axios to ^1.6.4 HOT 1
- IoT MQTT5 MqttConnectCustomAuthConfig has invalid typing for custom authorizer + browser HOT 14
- linux-arm64-musl pre built missing HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-crt-nodejs.