aws / aws-sdk-js-v3

Modularized AWS SDK for JavaScript.
Apache License 2.0
3.06k stars 573 forks source link

Cannot find module './924.js after upgrade from v3.490.0 to v3.540.0 #5990

Closed nikimicallef closed 5 months ago

nikimicallef commented 5 months ago

Checkboxes for prior research

Describe the bug

I actually do not know how to phrase this because I do not have much information to go off so if there is more information I can provide please tell me. I upgraded my lambdas from using client-s3, client-sqs, util-dynamodb and client-dynamodb from 3.490.0 to 3.540.0 and suddenly the execution of the lambda started failing. The stack trace I get is the following

{
    "errorType": "Error",
    "errorMessage": "Cannot find module './924.js'\nRequire stack:\n- /var/task/requestDeletion.js\n- /var/runtime/index.mjs",
    "code": "MODULE_NOT_FOUND",
    "requireStack": [
        "/var/task/requestDeletion.js",
        "/var/runtime/index.mjs"
    ],
    "stack": [
        "Error: Cannot find module './924.js'",
        "Require stack:",
        "- /var/task/requestDeletion.js",
        "- /var/runtime/index.mjs",
        "    at Module._resolveFilename (node:internal/modules/cjs/loader:1134:15)",
        "    at Module._load (node:internal/modules/cjs/loader:975:27)",
        "    at Module.require (node:internal/modules/cjs/loader:1225:19)",
        "    at require (node:internal/modules/helpers:177:18)",
        "    at r.f.require (/var/task/requestDeletion.js:2:621367)",
        "    at /var/task/requestDeletion.js:2:620954",
        "    at Array.reduce (<anonymous>)",
        "    at r.e (/var/task/requestDeletion.js:2:620932)",
        "    at /var/task/requestDeletion.js:2:342764",
        "    at /var/task/requestDeletion.js:2:380557"
    ]
}

Unfortunately, since the code is in TypeScript, I do not know exactly why this code is failing but from what I can see, it is related to the credentials handling since there is a reference to the credentials-provider-node slightly earlier. I think the issue is around the authentication between the lambda and Dynamo DB when using the DynamoDB client but I am not sure. Reverting back to v 3.490.0 seems to solve the issue but it doesn't get me closer to understanding the root cause.

Has there been a change in the transitive dependency to the DynamoDB client and the credentials-provider-node? It is some dependency that I am missing? I tried to find some release notes but I could not find any.

SDK version number

@aws-sdk/package-name@version, ...

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v18

Reproduction Steps

Upgrading from v3.490.0 to v3.540.0

Observed Behavior

Execution failed with exception

Expected Behavior

Execution is successful as it was previously

Possible Solution

No response

Additional Information/Context

No response

kuhe commented 5 months ago

Missing a file with a number as the name indicates it may be a chunk file generated by e.g. Webpack.

One thing to check is whether your generated or output bundle code has all been uploaded to the Lambda.

aBurmeseDev commented 5 months ago

Hi @nikimicallef - thanks for reaching out.

Has there been a change in the transitive dependency to the DynamoDB client and the credentials-provider-node? It is some dependency that I am missing?

I wasn't able to find any breaking changes around DynamoDB client or the credentials-provider-node that would cause this error. As mentioned by my colleague above, I would check to confirm if your bundle code has all completely uploaded to Lambda and/or try to locate the file name within your dependencies.

If issue persists, please share your code and list of dependencies you have.

Best, John

github-actions[bot] commented 5 months ago

This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.

github-actions[bot] commented 4 months ago

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.