Unable to compile Solidity smart contracts with latest version of compilers


I am new to OpenZeppelin and started exploring OZ for Upgradable contracts with Ethereum private network. I tried compiling solidity contract (eg contract taken from Remix) and I get error "Cannot convert undefined or null to object" on using any compiler version above 0.7.5.

Can someone please guide me here. Thanks.

Hey @prithi
can you share the code please? Maybe you are using some outdated syntax

This is a basic sample code taken from Remix IDE, It compiles with 0.7.5 and errors with higher versions.

// SPDX-License-Identifier: GPL-3.0

pragma solidity >=0.5.2 <0.9.0;

contract Storage {

uint256 number;

function store(uint256 num) public {
    number = num;

function retrieve() public view returns (uint256){
    return number;


Ok it compiles fine on my end. Did you try to clean your cache?

Hi, just to clarify, it compiles well with 0.7.5 compiler. Issue is with versions above 0.7.5