Saturday, November 15, 2025
HomeLanguagesJavascriptJavaScript URIError | Malformed URI Sequence

JavaScript URIError | Malformed URI Sequence

This JavaScript exception malformed URI sequence occurs if the encoding or decoding of URI is unsuccessful.

Message:

URIError: The URI to be encoded contains invalid character (Edge)
URIError: malformed URI sequence (Firefox)
URIError: URI malformed (Chrome)

Error Type:

URIError

Cause of the Error: This error is thrown as somewhere in the code, the URI encoding or decoding is unsuccessful.

Example 1: In this example, the value passed is not acceptable, therefore the error has occurred.

Javascript




// Error here
encodeURI('\uD810');


Output:

URIError: URI malformed

Example 2: In this example, the value passed is not acceptable, therefore the error has occurred.

Javascript




// Error here
decodeURIComponent('%E0%B4%A');


Output:

URIError: URI malformed
RELATED ARTICLES

Most Popular

Dominic
32399 POSTS0 COMMENTS
Milvus
95 POSTS0 COMMENTS
Nango Kala
6765 POSTS0 COMMENTS
Nicole Veronica
11917 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11984 POSTS0 COMMENTS
Shaida Kate Naidoo
6889 POSTS0 COMMENTS
Ted Musemwa
7143 POSTS0 COMMENTS
Thapelo Manthata
6838 POSTS0 COMMENTS
Umr Jansen
6840 POSTS0 COMMENTS