Skip to content
Advertisement

Command ‘Solidity: Compile Contract’ resulted in an error (Cannot read properties of undefined(reading ‘uri’))

Good day everyone, I am working on a lottery smart contract. I am currently done with the remix VM tests and proceeded with the unit tests with JavaScript. The test.js file is shown below.

JavaScript

The test file for now only checks if the contract deploys, pretty simple. However, I have not been able to proceed from here due to a particular error. Details on that will be shown below. I have checked for syntax and spelling errors but everything seems fine to me. Details on the compile.js and the error are provided below

The compile.js file:

JavaScript

The Error message:

error message

I made use of imports in the lottery.sol file.

Advertisement

Answer

I am currently debugging the same error as well for a NFT I am publishing… I imported the local directory into my Remix workspace and it compiled just fine… this leads me to believe the issue is a mismatch between compiler versions… not sure. VS Code was irritating me, so I just published through Remix and called it a day.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement