"PhotonView with ID 1001 has no method "ChatMessage" that takes 2 argument(s): String, Object[]" ... But it has....

I have got a chat script and it works, but now I wanted to add the player name. The error says that there is no RPC-Function that takes two arguments, but there is:

[RPC]
	void ChatMessage(string playerName, string msg){
	
		messages.Add (playerName + ": " + msg);

	}

And that’s how I call the function:

PhotonView photonView = PhotonView.Get(this);
				photonView.RPC("ChatMessage", PhotonTargets.All, PhotonNetwork.playerName, new object[]{currentMessage});

Can you help me?

ChatMessage takes the arguments string and string. You send a string and a object.
Try these two variants (maybe they even work both):

photonView.RPC("ChatMessage", PhotonTargets.All, new object[]{PhotonNetwork.playerName, currentMessage});

photonView.RPC("ChatMessage", PhotonTargets.All, PhotonNetwork.playerName, currentMessage);