DeprecationWarning for `url.parse()` with Node.js v24

Open
#6,165 0 comments 2 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Domain
frontend

Research direction

The trace points to XMLHttpRequest3._parseUrl in the built server bundle, but the issue does not identify the source file or other uses of url.parse(). Start by building and running dspace-angular with Node.js v24 and tracing the deprecation to locate the source call sites. Done when the deprecated calls responsible for the warning are addressed and the warning no longer appears on the first page load.

Written by the indexing model from the issue text.

Description

affects: main bug code task

Describe the bug

When building and running current main (DSpace 11.0-next) on Node.js v24 the following warning is thrown:

(node:46830) [DEP0169] DeprecationWarning: `url.parse()` behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for `url.parse()` vulnerabilities.
(Use `node --trace-deprecation ...` to show where the warning was created)

By enabling tracing, this stack is shown on the first page load to http://localhost:4000/home:

(node:48913) [DEP0169] DeprecationWarning: `url.parse()` behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for `url.parse()` vulnerabilities.
    at Object.urlParse [as parse] (node:url:136:13)
    at XMLHttpRequest3._parseUrl (/home/aorth/src/git/dspace-angular/dist/server/main.js:1:3270228)
    at XMLHttpRequest3.open (/home/aorth/src/git/dspace-angular/dist/server/main.js:1:3263395)
    at Observable2._subscribe (/home/aorth/src/git/dspace-angular/dist/server/main.js:1:3880057)
    at Observable2._trySubscribe (/home/aorth/src/git/dspace-angular/dist/server/main.js:1:2991137)
    at /home/aorth/src/git/dspace-angular/dist/server/main.js:1:2991029
    at Object.errorContext (/home/aorth/src/git/dspace-angular/dist/server/main.js:1:3183455)
    at Observable2.subscribe (/home/aorth/src/git/dspace-angular/dist/server/main.js:1:2990858)
    at /home/aorth/src/git/dspace-angular/dist/server/main.js:1:3121340
    at OperatorSubscriber2._this._next (/home/aorth/src/git/dspace-angular/dist/server/main.js:1:3048844

I guess there are a handful of places we are using this deprecated behavior.

To Reproduce

Steps to reproduce the behavior:

  1. Build dspace-angular with Node.js v24
Dominant language
TypeScript
Stars
180
Forks
577
Avg merge
2d 1h
Merged PRs (30d)
100

Getting set up

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.

More from DSpace/dspace-angular

All issues in DSpace/dspace-angular

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.