Parts of a URL this parser exposes
A successful check means new URL(input) did not throw. The message echoes protocol (including the trailing slashes) and host, which bundles hostname and port when present. Path, query, hash, and credentials are accepted silently—you still need to inspect the full string if those pieces matter for your bug.
Why a URL might look fine but fail
Illegal characters without encoding, a missing scheme, or stray spaces inside the host usually trigger “Not a valid URL.” Internationalised domain names must be punycode or properly encoded depending on browser support—what works in the address bar may still need normalisation in config files.