You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to update my nodejs version from 16.x to 18.x.
And when I run npx aws-sdk-js-codemod -t v2-to-v3, he statement var AWS = require("aws-sdk"); not changed after converted.
varAWS=require("aws-sdk");const{ fromEnv }=require("@aws-sdk/credential-providers");varendpoint=newAWS.Endpoint(domain);varrequest=newAWS.HttpRequest(endpoint,region);request.method=method;request.path+=index;request.body="";request.headers["host"]=domain;request.headers["Content-Type"]="application/json";request.headers["Content-Length"]=Buffer.byteLength(request.body);varcredentials=// JS SDK v3 switched credential providers from classes to functions.// This is the closest approximation from codemod of what your application needs.// Reference: https://www.npmjs.com/package/@aws-sdk/credential-providersfromEnv("AWS");varsigner=newAWS.Signers.V4(request,"es");signer.addAuthorization(credentials,newDate());varclient=newAWS.HttpClient();client.handleRequest(request,null,function(response){console.log(response.statusCode+" "+response.statusMessage);varresponseBody="";response.on("data",function(chunk){responseBody+=chunk;});response.on("end",function(chunk){success(responseBody);});},function(error){console.log("Error: "+error);});
Observed behavior
$ npx aws-sdk-js-codemod -t v2-to-v3 part.js╔════════════════════════════════════════════════════════╗║ Please review the code change thoroughly for required ║║ functionality before deploying it to production. ║║ ║║ If the transformation is not complete or is incorrect, ║║ please report the issue on GitHub. ║╚════════════════════════════════════════════════════════╝Processing 1 files...Spawning 1 workers...Sending 1 files to free worker...All done.Results:0 errors0 unmodified0 skipped1 okTime elapsed: 0.244seconds
Expected behavior
require("aws-sdk"); should changed to something from '@aws-sdk/XXX' right?
And AWS.Signers ,AWS.HttpRequest , AWS.Endpoint should changed relevantly
Self-service
Describe the bug
I'd like to update my nodejs version from 16.x to 18.x.
And when I run
npx aws-sdk-js-codemod -t v2-to-v3
, he statementvar AWS = require("aws-sdk");
not changed after converted.Steps to reproduce
source fie
output
Observed behavior
Expected behavior
require("aws-sdk"); should changed to something from '@aws-sdk/XXX' right?
And
AWS.Signers
,AWS.HttpRequest
,AWS.Endpoint
should changed relevantlyEnvironment
Additional context
No response
The text was updated successfully, but these errors were encountered: