TypeError: Failed to execute ‘fetch’ on ‘Window’: Invalid value

Double-check the value in your Authorization header for invalid characters:

This also happened to me when I tried to add an Authorization header to my fetch calls, due to an invalid character in the Authorization key.

In my case it was caused by a newline (\n) character in the header string, i.e. Bearer:\nsomelong-token. Changing the new line to a space solved the problem.

Note, that most special characters are typically not valid for authorization tokens.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)