Skip to content
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

Error: Cannot find module '@aws-sdk/lib-dynamodb/dist-cjs/commands/utils' #398

Closed
pablote opened this issue Jul 3, 2024 · 6 comments
Closed

Comments

@pablote
Copy link

pablote commented Jul 3, 2024

Describe the bug
I just created a very simple npm project to test electrodb, and I get the above error. The schemas and code are the same as in the Quickstart page. The only difference is that I'm not using the deprecated aws-sdk package, and instead using @aws-sdk/client-dynamodb.

The problem seems to be with this line: https://github.com/tywalch/electrodb/blob/master/src/client.js#L2

ElectroDB Version
2.14.1

ElectroDB Playground Link
.

Entity/Service Definitions
Same as the Quickstart.

Expected behavior
Expected it to run.

Errors

Here's the full error:

Error: Cannot find module '@aws-sdk/lib-dynamodb/dist-cjs/commands/utils'
Require stack:
- /Users/pablo/Documents/work/projects/personal/test-electrodb/node_modules/electrodb/src/client.js
- /Users/pablo/Documents/work/projects/personal/test-electrodb/node_modules/electrodb/src/entity.js
- /Users/pablo/Documents/work/projects/personal/test-electrodb/node_modules/electrodb/index.js
- /Users/pablo/Documents/work/projects/personal/test-electrodb/entities.ts
- /Users/pablo/Documents/work/projects/personal/test-electrodb/index.ts
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1134:15)
    at Function.Module._resolveFilename.sharedData.moduleResolveFilenameHook.installedValue [as _resolveFilename] (/Users/pablo/Documents/work/projects/personal/test-electrodb/node_modules/@cspotcode/source-map-support/source-map-support.js:811:30)
    at Function.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 Object.<anonymous> (/Users/pablo/Documents/work/projects/personal/test-electrodb/node_modules/electrodb/src/client.js:2:14)
    at Module._compile (node:internal/modules/cjs/loader:1356:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
    at Object.require.extensions.<computed> [as .js] (/Users/pablo/Documents/work/projects/personal/test-electrodb/node_modules/ts-node/src/index.ts:1608:43)
    at Module.load (node:internal/modules/cjs/loader:1197:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/pablo/Documents/work/projects/personal/test-electrodb/node_modules/electrodb/src/client.js',
    '/Users/pablo/Documents/work/projects/personal/test-electrodb/node_modules/electrodb/src/entity.js',
    '/Users/pablo/Documents/work/projects/personal/test-electrodb/node_modules/electrodb/index.js',
    '/Users/pablo/Documents/work/projects/personal/test-electrodb/entities.ts',
    '/Users/pablo/Documents/work/projects/personal/test-electrodb/index.ts'
  ]
}
@sargisshahinyan
Copy link

This happens after updating@aws-sdk/lib-dynamodb to version 3.609.0. On version 3.606.0 everything works.

If you need quick solution until issue is fixed just rollback version.

@arpadgabor
Copy link

arpadgabor commented Jul 3, 2024

Happened here as well, if you don't use the lib directly just use overrides, pnpm example:

"pnpm": {
  "overrides": {
    "@aws-sdk/lib-dynamodb": "3.395.0"
  }
},

3.395 is the version used by electrodb

@tywalch
Copy link
Owner

tywalch commented Jul 4, 2024

Thank you for raising this, I will look into it 👍

@tywalch
Copy link
Owner

tywalch commented Jul 7, 2024

I just pushed 2.14.2, @pablote, @sargisshahinyan, and/or @arpadgabor can you confirm whether or not this changes the behavior you see?

@pablote
Copy link
Author

pablote commented Jul 8, 2024

works fine with the latest version 👍🏻

@pablote pablote closed this as completed Jul 8, 2024
@imjulianeral
Copy link

Awesome, thanks for patching this asap @tywalch <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants