payloadcms / payloadcms/payload

url.parse() deprecation warning persists due to mongoose@8.x pinning mongodb@6.x

Open
#16,201 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

created-by: Contributor db: mongodb
Dominant language
TypeScript
Stars
44.8k
Forks
4.2k
Avg merge
2d 21h
Merged PRs (30d)
53

Description

Describe the Bug

The url.parse() deprecation warning (DEP0169) was partially fixed in Payload v3.69.0 (#14978), but still occurs because @payloadcms/db-mongodb pins mongoose@8.15.1, which depends on mongodb@~6.16.0.

The MongoDB driver 6.x uses url.parse() internally (e.g. in mongodb/lib/utils.js). This was fixed in mongodb@7.x, which ships with mongoose@9.x.

Dependency chain:

@payloadcms/db-mongodb → mongoose@8.15.1 → mongodb@~6.16.0 (uses url.parse)

Proposed fix: Upgrade to mongoose@^9.x which depends on mongodb@~7.1 (no more url.parse()).

Link to the code that reproduces this issue

https://github.com/payloadcms/payload/blob/main/packages/db-mongodb/package.json#L55

Reproduction Steps
  1. Create a Payload project with @payloadcms/db-mongodb
  2. Run with NODE_OPTIONS=--trace-deprecation
  3. Observe DEP0169 warning originating from mongodb/lib/utils.js (via mongoose 8.x)
Which area(s) are affected?

db: mongodb

Environment Info
Payload: 3.81.0 (latest)
mongoose: 8.15.1
mongodb: 6.16.0
Node: >= 21 (where DEP0169 is emitted)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with packages/db-mongodb/package.json at the dependency line mentioned in the issue, then verify the installed Mongoose and MongoDB versions. Reproduce with NODE_OPTIONS=--trace-deprecation and a Payload project using @payloadcms/db-mongodb. Done means the supported dependency upgrade is compatible and the DEP0169 warning no longer originates from mongodb/lib/utils.js.

Written by the indexing model from the issue text.

Assessment

Tech stack
mongodb, nodejs, typescript
Domain
backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.