Closed tahirmolkar closed 2 years ago
Same issue as described at https://stackoverflow.com/questions/70041745/webpack-external-module-gives-an-error-on-optimization if it helps. The Stack Overflow question has more details.
Currently experiencing the same issue. Is there a solution yet? Downgrading to the version proposed in the stackoverflow issue unfortunately didn't solve it for me. Using aws-sdk 2.1046 with angular 13
Simply call the list user API manually
try to reduce the version of amazon-cognito-identity-js to "^3.3.3"
Experienced the same problem after upgrading ng v11 -> 12. "amazon-cognito-identity-js": "^5.2.4",
Downgraded to "^3.3.3" (latest stable version) and error has resolved.
@DanielLMA apologies the issue fell out of queue. https://www.npmjs.com/package/amazon-cognito-identity-js seems to be handled by https://github.com/aws-amplify/amplify-js
Closing this issue now, please open a new issue if any other questions.
I am getting following error when try to build my project in angular I have used this to list cognito users so when we comment out code regarding this library then angular builds successfully
Error: Optimization error [8029-es2017.561d40d2ba468e9af625.js]: Error: Transform failed with 1 error: 8029-es2017.561d40d2ba468e9af625.js:131:5: error: Expected identifier but found "=" at failureErrorWithLog (D:\Node\workspace-framework - Copy\node_modules\esbuild\lib\main.js:1449:15) at D:\Node\workspace-framework - Copy\node_modules\esbuild\lib\main.js:1260:29 at D:\Node\workspace-framework - Copy\node_modules\esbuild\lib\main.js:609:9 at handleIncomingPacket (D:\Node\workspace-framework - Copy\node_modules\esbuild\lib\main.js:706:9) at Socket.readFromStdout (D:\Node\workspace-framework - Copy\node_modules\esbuild\lib\main.js:576:7) at Socket.emit (node:events:394:28) at addChunk (node:internal/streams/readable:315:12) at readableAddChunk (node:internal/streams/readable:289:9) at Socket.Readable.push (node:internal/streams/readable:228:10) at Pipe.onStreamRead (node:internal/stream_base_commons:199:23)
following is my code
import AWS from 'aws-sdk/global'; import CognitoIdentityServiceProvider from 'aws-sdk/clients/cognitoidentityserviceprovider';
@Component({ selector: 'vex-forgot-password', templateUrl: './forgot-password.component.html', styleUrls: ['./forgot-password.component.scss'], animations: [fadeInUp400ms], }) export class ForgotPasswordComponent {
cognitoIdentityServiceProvider: any;
constructor(private router: Router) { let conf = new AWS.Config({ accessKeyId: environment.AccessKeyId, secretAccessKey: environment.SecretAccessKey, region: environment.Region, });
}
sendCode = (model) => { let that = this;
};
}