payloadcms / payloadcms/payload
url.parse() deprecation warning persists due to mongoose@8.x pinning mongodb@6.x
Nobody has claimed this yet.
- 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
- Create a Payload project with
@payloadcms/db-mongodb - Run with
NODE_OPTIONS=--trace-deprecation - 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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