denodrivers / denodrivers/mongo
Connection failed: Failed to normalize algorithm: 'iterations' of 'Pbkdf2Params' (passed algorithm) is not a finite number
- Dominant language
- TypeScript
- Stars
- 511
- Forks
- 89
- PR merge metrics
- No merged PRs in 30d
Description
When deploying to Deno Deploy, the app crashes during MongoDB connection when using [@db/mongo@0.34.0](https://jsr.io/@db/mongo).
Downgrading to [deno.land/x/mongo@v0.32.0](https://deno.land/x/mongo@v0.32.0/mod.ts) resolves the issue.
Error:
```sh
Error: MongoError: "Connection failed: Failed to normalize algorithm: 'iterations' of 'Pbkdf2Params' (passed algorithm) is not a finite number"
at MongoClient.connect (https://jsr.io/@db/mongo/0.34.0/src/client.ts:61:13)
at eventLoopTick (ext:core/01_core.js:178:7)
at async connect (file:///home/runner/work/fresh-app-practice/fresh-app-practice/database/connect.ts:7:12)
at async getConnection (file:///home/runner/work/fresh-app-practice/fresh-app-practice/database/connect.ts:27:16)
```
This issue does not occur locally — only on Deno Deploy
I’m using a MongoDB Atlas connection string with SCRAM-SHA-1:
```ts
await client.connect(
"mongodb+srv://:@/?authMechanism=SCRAM-SHA-1",
);
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with src/client.ts:61 and reproduce the MongoDB Atlas SCRAM-SHA-1 connection from database/connect.ts:7 on Deno Deploy using @db/mongo 0.34.0. Compare the failing deployment with the working deno.land/x/mongo v0.32.0 path; done means the connection no longer fails while normalizing the PBKDF2 iterations value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- deno, mongodb, typescript
- Domain
- database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100