Getting a very strange error with AWS Cognito provider.
I stepped away from our back-end Node JS repo for a few weeks, and suddenly our sign-in endpoint is no longer working.
{
"message": {
"errorType": "Error",
"errorMessage": "Cannot find package '@aws-sdk/client-cognito-identity-provider' imported from /var/task/index.mjs",
"trace": [
"Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@aws-sdk/client-cognito-identity-provider' imported from /var/task/index.mjs",
" at new NodeError (internal/errors.js:322:7)",
" at packageResolve (internal/modules/esm/resolve.js:732:9)",
" at moduleResolve (internal/modules/esm/resolve.js:773:18)",
" at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:887:11)",
" at Loader.resolve (internal/modules/esm/loader.js:89:40)",
" at Loader.getModuleJob (internal/modules/esm/loader.js:242:28)",
" at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:76:40)",
" at link (internal/modules/esm/module_job.js:75:36)",
" at process.runNextTicks [as _tickCallback] (internal/process/task_queues.js:60:5)",
" at /var/runtime/deasync.js:23:15"
]
},
"error": null
Situation
- no other team mates using the same repo, are getting this
- no code changes were made on my end
- going back to a branch made weeks ago that was working fine, is also throwing this error.
What I’ve tried
-
tried with Node versions 22, 20, and 14.
-
tried updating that particular package, and all the other AWS packages we use.
-
deleted and reinstalled the node_modules
-
Completely deleted and re-cloned the repo
Extra Notes
This error only shows in Postman when I hit the sign-in endpoint. There are no errors when starting the server. This error does not show in my console, only in Postman.