Can't deploy upgradeable contract

I'm trying to deploy the following smart contract:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

contract MonstersOnTheWayUp is Initializable, ERC20Upgradeable {
    function initialize() initializer public {
        __ERC20_init("Promethium", "PRM");
    }
}

I'm using this script for migration:

// migrations/3_deploy_upgradeable_box.js
const { deployProxy } = require('@openzeppelin/truffle-upgrades');

const MonstersOnTheWayUp = artifacts.require("../contracts/MonstersOnTheWayUp");

module.exports = async function (deployer) {
  await deployProxy(MonstersOnTheWayUp, [""], { deployer, initializer: 'initialize' });
};

But when I try to run the command:

npx truffle deploy --reset --network rinkeby

I get the following error:

Error: The requested contract was not found. Make sure the source code is available for compilation

Why is this happening? This is my project directory:

The second parameter for deployProxy isn't needed if you don't have any initializer arguments.

So just do await deployProxy(MonstersOnTheWayUp, { deployer, initializer: 'initialize' });


Regarding the error message, do any of your contracts import interfaces from @openzeppelin/contracts-upgradeable/interfaces? If so, change the import to the path of the actual interface. For example if you have

import "@openzeppelin/contracts-upgradeable/interfaces/IERC20Upgradeable.sol";

change it to:

import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";

There is a GitHub issue opened for this here: https://github.com/OpenZeppelin/openzeppelin-upgrades/issues/549