-
Notifications
You must be signed in to change notification settings - Fork 597
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
Module not found: Can't resolve 'fs' in 'node_modules/@aws-sdk/lib-storage/dist/es #2564
Comments
I was able to get it working by using this fix cross posted in webpack issues. I had to use the |
ahh scratch that. The build succeeds, but now it's failing at run time 😕 |
For now I have moved to v2 till this is sorted out. |
Hi @fanatic75 thanks for bringing this one, I wasn't able to reproduce it. This was initially because |
@ajredniwja Here's a repo that reproduces the issue. I used Angular CLI to generate a new v11 project, then added |
@grothem thanks, I'll try to work with it, would be some time. |
Hi there, it turns out to be a dependency issue just add:
In your package.json and it should work as expected. |
Hey @ajredniwja , |
@fanatic75, let me share my package.json |
This is what I used, some of which was copied from the react project I had and the angular app ran perfectly uploading stuff on S3. |
Thanks @ajredniwja, that did fix the build errors for me. Is this something that could be added to the @aws-sdk/lib-storage module package.json, instead of having the end users specify this config? |
@grothem yes, would need to find which package it is. |
After applying those fixes, it still fails with Angular 12, that uses Webpack v5. This is the core of the package.json used:
Also
Any ideas? |
Failing in a React app using Next 11 (which is also Webpack 5), even after adding the |
@ajredniwja just wondering if there was any update on this. I'm now running into issues using v2 of aws-sdk and angular 12 (see this issue) |
testing this now, working in react app using the latest packages, the test included uploading some stuff to S3 |
The code I used: export const s3Test = async () => {
// debugger;
const creds = fromCognitoIdentityPool({
client: new CognitoIdentityClient({ region }),
identityPoolId: idPool,
});
const client = new S3Client({
region,
credentials: credentials
});
const Key = `${Date.now()}-new-key`;
let upload = new Upload({
client,
tags: [{
Key: "my-tag-key",
Value: "my-tag-value"
}],
params: { Key, Bucket,
Body: "hello world!"
}
});
upload.on("httpUploadProgress", (progress ) => {
console.log(progress);
});
const uploadResult = await upload.done();
// debugger;
console.log("done uploadingg", uploadResult);
} |
For Angular using web-pack 5 it is using the node config to build which causes this error, which uses |
A webpack team member explained the cause of this issue here: webpack/webpack#13498 (comment) Basicly, the |
@grothem did you solve this. I'm experiencing the same issue. Webpack is creating the bundle with 3 WARNINGS (no errors) but the resulting bundle doesn't work. It launches an error like this:
|
@robec1982 It's working for me now with the latest version of the sdk |
seems like this is solved based on the last comment and the lack of activity. Thanks, |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
Describe the bug
Angular project not building because of FS error, is there no way to upload big files to s3 via Angular 11 with v3 sdk ?
Your environment
Angular - 11,
Win 10
SDK version number
3.20.0
Is the issue in the browser/Node.js/ReactNative?
Browser
Details of the browser/Node.js/ReactNative version
Paste output of
npx envinfo --browsers
ornode -v
orreact-native -v
v14.15.1
Steps to reproduce
Observed behavior
Angular app crashes
Expected behavior
Use the library
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
duplicate of #2136
The text was updated successfully, but these errors were encountered: