Could not parse type with internal type: undefined for custom structure
See original GitHub issueI have some contracts using a library structure data storage, compiled using an older version of Solidity, but which throw an error asking me to make a report here.
In the libraryType.sol
contract I have something like this:
library PersonLib {
struct Data {
bool isActive;
bytes hashOfData;
string handle;
}
function handle(Data storage self) public view returns (string) {
return self.handle;
}
function markActive(Data storage self) internal {
self.isActive = true;
}
//other getters & setters omitted
}
In other contracts, the library contract is imported and the type of a variable or struct member might be PersonLib.Data
- sometimes, there are more than one of the same type in the same file (e.g. a Requester
and a Contributor
with wrapper functions similar to this:
function requesterHandle() public view returns (string) {
return requester.handle;
}
function updateRequesterHandle(string newHandle) public {
emit RequesterHandleUpdated(newHandle);
PersonLib.updateHandle(requester, newHandle);
}
That works fine in Solidity, but when trying to generate types with TypeChain, that triggers an error like this:
Could not parse type: PersonLib.Data storage with internal type: undefined.
Please submit a GitHub Issue to the TypeChain team with the failing contract/library.
This error report is hereby filed per request. Hopefully I haven’t missed something important when attempting to make it a minimal example for the report.
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:7 (7 by maintainers)
Thanks for your reply!
I got an error with this parameters:
--target=truffle-v4
and Solidity version “0.6.4”. I also try with solidity version “0.4.24” and same target--target=truffle-v4
.Both case i got this error:
Error occured: Class extends value undefined is not a constructor or null
. I was unable to get the same message you posted at the beginning of this issue.“V5” is related to Typechain is not related with ethereum. Please try to compile Smart Contracts with this target and give me a feedback. If there are no compilation errors I would say close the issue as “truffle-v4” I think is deprecated, correct? @krzkaczor
I wound up changing Typechain and dependencies to use --target=truffle-v4 and it still produced the same errors.