console.log DeclarationError: Undeclared identifier in Solidity
See original GitHub issueIssue: console.log
is throwing an error in remix.
Code :
contract LoanFactory {
Loan[] loans;
constructor() {}
function createLoan() external {
Loan loan = new Loan(100);
loans.push(loan);
console.log(loan);
address(loan);
}
}
Error :

Issue Analytics
- State:
- Created 9 months ago
- Comments:5
Top Results From Across the Web
console.log DeclarationError: Undeclared identifier. #1833
In chrome it works as expected. It seems to be an issue with my browser (latest firefox). I had several glitches recently, ...
Read more >DeclarationError: Undeclared identifier - solidity
The code is failing to compile due to the error: browser/Token.sol:73:17: DeclarationError: Undeclared identifier. if (approve(_spender, ...
Read more >DeclarationError: Undeclared identifier. error in remix
You got this error because the pricefeed is not declared or visible for the function.
Read more >Truffle compile shows DeclarationError Undeclared identifier
Hey. I have made some changes to truffle metacoin and when I run truffle compile command, I get the following error: Compiling ....
Read more >ethereum/solidity - Gitter
I just copied a function to a new contract and I get an error after using this function. Message: DeclarationError: Undeclared identifier.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
As of now, there is no support for complex data types
@SaikrishnaReddy1919 seems
loan
is astruct
variable, that can be reason of error. You can try to log individual property.