I'm using ldapjs inside of NextJS 14 and a production build breaks the client.search() function which is a nodejs EventEmitter implementation. The search function fires off and then listens for events; in development mode the "searchEntry" event fires as expected when the ldap server returns results, but in production mode it does not.
I have confirmed using Wireshark that in both the dev server as well as production server the ldap search is returning results as expected; however, something is keeping the production server from noticing/processing the results; it just hangs there until the timeout function fires.
Here is my code:
https://gist.github.com/Tesin/a9aeb11710c54c008622583087b89c19
I am authenticating against the ldap server using a Service Account which will then let me execute a search for the user and retrieve the full DN.
Here is the reference documentation for client.search():
https://ldapjs.org/client.html#search
I've suspected this to be a caching issue but i've tried everything I know to disable caching using route segment config all over this project.
Halp, please 😦