-
Notifications
You must be signed in to change notification settings - Fork 228
Closed
Labels
Description
Description
When performing a server-side search using the Algolia client in a Next.js (App Router) environment, the application throws a warning due to the use of the deprecated url.parse() API (Node.js internal code DEP0169).
This occurs during the execution of:
import algoliasearch from 'algoliasearch/lite';
const algoliaClient = algoliasearch('xxx', 'xxx');
...
const response = await algoliaClient.search(requests);
Environment
- Framework: Next.js 16 (App Router)
- Library: algoliasearch@4.25.3
- Node.js Version: 24
Steps to Reproduce
- Set up an Algolia client using the "Backend Search" pattern in Next.js.
- Call algoliaClient.search(requests) within a Server Action or a Server Component.
- Trigger a search request.
- The process terminates with DEP0169 uncaught exception.
Expected Behavior
The client should use the standard WHATWG URL API (new URL()) for URL parsing to comply with modern Node.js standards and avoid security implications as suggested by the Node.js core.
Actual Behavior
The client seems to be using url.parse(), which triggers a critical warning that, in certain strict environments or under specific Node.js configurations, results in an uncaughtException that crashes the dev server.
Client
Search
Version
algoliasearch@4.25.3
Relevant log output
> uncaughtException: DeprecationWarning: `url.parse()` behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead.
at new Promise (<anonymous>)
at async fetchResultsServer (./results.js:22:24)
at async Object.search (./client.js:23:21)
|
| const response = await algoliaClient.search(requests);
|
code: 'DEP0169'Reactions are currently unavailable