Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-4203

Optionally import whatwg-url if global URL has buggy behavior

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 4.1.1
    • Component/s: None
    • Labels:

      What problem are you facing?

      mongodb-connection-string-url added a dependency of whatwg-url to bypass a bug with the global URL in some environments. Unfortunately this leads to an issue with the global TextEncoder being a dependency which is not made available in jsdom/jest testing environments.

      Is this fixable?

      Despite the driver only being tested and supported in environments that do have TextEncoder defined would it be possible to circumvent the need for this dependency?

      If we can detect the buggy behavior observed in the protocol parsing we could import whatwg-url only when needed. However, we should check if this will even fix the issue for jsdom users as the global URL implementation may have the buggy behavior and we will end up importing the whatwg-url implementation anyway.

            Assignee:
            Unassigned Unassigned
            Reporter:
            neal.beeken@mongodb.com Neal Beeken
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: