You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to get solidity-docgen (installed from npm, specified as '^0.6.0-beta.17' in package.json) to compile files for me, without transitioning from Truffle to Hardhat, by using the following script:
Note that the CurrencyManager.json file is the json output after truffle compiled -- it does have an 'ast' field present, as indicated by the readme. To my understanding, this this script is equivalent the current readme example usage, although I am of course confused by what exactly the 'output' parameter needs to be. The error I get if I run this:
undefined:1
undefined
^
SyntaxError: Unexpected token u in JSON at position 0
at JSON.parse (<anonymous>)
at clone (/home/miko/solidity/karmaToken/node_modules/solidity-docgen/dist/utils/clone.js:9:29)
at buildSite (/home/miko/solidity/karmaToken/node_modules/solidity-docgen/dist/site.js:27:41)
at main (/home/miko/solidity/karmaToken/node_modules/solidity-docgen/dist/main.js:20:39)
at Object.<anonymous> (/home/miko/solidity/karmaToken/docify.js:6:1)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
Taking a look at the offending function in site.js, I get the following -- the error occurs when we try to pass originalBuild.input to some function clone, where originalBuild is actually the element inside the array I passed in the config. The error seems to be happening because the code required the 'input' field to be json-parseable, while it is recommended to be undefined in the readme.
functionbuildSite(builds,siteConfig){var_a;constassign=typeofsiteConfig.pages==='string' ? exports.pageAssigner[siteConfig.pages] : siteConfig.pages;constseen=newSet();constitems=[];constpages={};for(constoriginalBuildofbuilds){// Clone because we will mutate in order to add item context.constoutput=(0,clone_1.clone)(originalBuild.output);constinput=(0,clone_1.clone)(originalBuild.input);constderef=(0,utils_1.astDereferencer)(output);constbuild={ input, output, deref };for(const{ast: file}ofObject.values(build.output.sources)){
I understand that this project is mostly concerned with supporting the hardhat use-case. Was hoping for clarification if this raw use-case is even possible and, if so, how we should go about doing it.
👍👍 Thanks for supporting!
The text was updated successfully, but these errors were encountered:
Hardhat isn't required, this library just needs the output from solc, the compiler. The JSON file that you mention doesn't contain this full output, it's just a subset of it, so it won't be enough. Truffle doesn't expose the full output from the compiler so it won't be possible to use it out of the box.
Trying to get solidity-docgen (installed from npm, specified as '^0.6.0-beta.17' in package.json) to compile files for me, without transitioning from Truffle to Hardhat, by using the following script:
Note that the CurrencyManager.json file is the json output after truffle compiled -- it does have an 'ast' field present, as indicated by the readme. To my understanding, this this script is equivalent the current readme example usage, although I am of course confused by what exactly the 'output' parameter needs to be. The error I get if I run this:
Taking a look at the offending function in site.js, I get the following -- the error occurs when we try to pass
originalBuild.input
to some function clone, where originalBuild is actually the element inside the array I passed in the config. The error seems to be happening because the code required the 'input' field to be json-parseable, while it is recommended to be undefined in the readme.I understand that this project is mostly concerned with supporting the hardhat use-case. Was hoping for clarification if this raw use-case is even possible and, if so, how we should go about doing it.
👍👍 Thanks for supporting!
The text was updated successfully, but these errors were encountered: