Like this error indicates, you have to use calldata as location for data
Try this:
function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes calldata data) external payable;
Seems like you are using an external function and hence it is required to use calldata when you use external functions as above.