Lending in relation to inflation

We are living in an interest-debt based economic system and dealing with fiat currencies. Though they are fundamentally un-Islamic, we have no choice but to live with it. Inflation is significantly high in this fraction reserve banking system.

So if a person lend, for example, $1 million to someone and was repaid in 10 years, the value of $1 million would have significantly reduced over the years due to inflation, incurring value loss for the lender.

Without charging interest, how the loss can be mitigated or avoided? Can the lender charge a fee for the lent amount based on inflation rate? If can’t, what else could be the solution? Please clarify. Jazakhallah Khair.