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

Trying to deploy Upgradeable contract i get an error.
Also i get strange warnings during the compilation, but i don’t have any duplicates in my truffle project.
I didn’t catch such problems before.

:1234: Code to reproduce

Error: The requested contract was not found. Make sure the source code is available for compilation
> Duplicate contract names found for IAirdrop.
> This can cause errors and unknown behavior. Please rename one of your contracts.

> Duplicate contract names found for IERC20Mintable.
> This can cause errors and unknown behavior. Please rename one of your contracts.

> Duplicate contract names found for IMasterChief.
> This can cause errors and unknown behavior. Please rename one of your contracts.

:computer: Environment

Truffle v5.4.1 (core: 5.4.1)
Solidity - 0.8.4 (solc-js)
Node v14.17.0
Web3.js v1.4.0
@openzeppelin/truffle-upgrades 1.8.0
@openzeppelin/contracts-upgradeable 4.2.0

add the source code to your post so we can see the problem

1 Like

Try cleaning your artifacts directory. If it doesn’t help please share a repository where we can reproduce the issue.

This is related to some shortcomings of Truffle. The Upgrades plugin for Hardhat will not have the same issue.

Deleted build directory multiple times. Nothing ve changed. But i can 't share my repo because it’s closed as comercial project

Has anything changed in your Solidity code since you started running into this error?