OpenZeppelin / solidity-docgen

Documentation generator for Solidity projects
MIT License
441 stars 116 forks source link

`importedScope[a.foreign.name]` when updating >`0.6.0-beta.19` #436

Closed heueristik closed 1 year ago

heueristik commented 1 year ago

When updating solidity-docgen to a version >0.6.0-beta.19, it throws the following error for our contracts:

TypeError: importedScope[a.foreign.name] is not a function
    at scope.<computed> (/Users/user/Projects/Aragon/osx/node_modules/solidity-docgen/src/utils/scope.ts:43:116)
    at /Users/user/Projects/Aragon/osx/node_modules/solidity-docgen/src/utils/scope.ts:55:17
    at Array.flatMap (<anonymous>)
    at flattenScope (/Users/user/Projects/Aragon/osx/node_modules/solidity-docgen/src/utils/scope.ts:54:27)
    at getContractsInScope (/Users/user/Projects/Aragon/osx/node_modules/solidity-docgen/src/utils/scope.ts:14:5)
    at parseNatspec (/Users/user/Projects/Aragon/osx/node_modules/solidity-docgen/src/utils/natspec.ts:104:49)
    at natspec (/Users/user/Projects/Aragon/osx/node_modules/solidity-docgen/src/common/properties.ts:18:22)
    at /Users/user/Projects/Aragon/osx/node_modules/solidity-docgen/src/site.ts:124:51
    at Object.get [as natspec] (/Users/user/Projects/Aragon/osx/node_modules/solidity-docgen/src/utils/memoized-getter.ts:17:19)
    at lookupProperty (/Users/user/Projects/Aragon/osx/node_modules/handlebars/lib/handlebars/runtime.js:130:26)
error Command failed with exit code 1.

See the PR in our repo: https://github.com/aragon/osx/pull/311 and the respective error https://github.com/aragon/osx/actions/runs/4302447866/jobs/7500951007#step:9:23

Steps to Reproduce

git clone --branch feature/docgen https://github.com/aragon/osx.git
cd osx/packages/contracts/
yarn install
yarn docgen
frangio commented 1 year ago

Thanks for the issue. I've fixed this in https://github.com/OpenZeppelin/solidity-docgen/commit/7939beaea14c4bf2f08ea2d05f1e65074b27e137 in the latest release (beta 35).