When I issue pnpm build in packages/contract, and I have a syntax error, I often get something I can't understand, such as
qbzzt1@penguin:~/zk/packages/contracts$ pnpm build
> contracts@0.0.0 build /home/qbzzt1/zk/packages/contracts
> mud build
(node:21973) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
null
/home/qbzzt1/zk/node_modules/.pnpm/@solidity-parser+parser@0.16.2/node_modules/@solidity-parser/parser/dist/index.cjs.js:9347
throw new RangeError("index parameter must be between >= 0 and <= number of children.");
^
RangeError: index parameter must be between >= 0 and <= number of children.
at SimpleStatementContext.getChild (/home/qbzzt1/zk/node_modules/.pnpm/@solidity-parser+parser@0.16.2/node_modules/@solidity-parser/parser/dist/index.cjs.js:9347:15)
at ASTBuilder.visitSimpleStatement (/home/qbzzt1/zk/node_modules/.pnpm/@solidity-parser+parser@0.16.2/node_modules/@solidity-parser/parser/dist/index.cjs.js:35689:27)
at SimpleStatementContext.accept (/home/qbzzt1/zk/node_modules/.pnpm/@solidity-parser+parser@0.16.2/node_modules/@solidity-parser/parser/dist/index.cjs.js:33857:22)
at ASTBuilder.visit (/home/qbzzt1/zk/node_modules/.pnpm/@solidity-parser+parser@0.16.2/node_modules/@solidity-parser/parser/dist/index.cjs.js:17669:19)
at ASTBuilder.visitStatement (/home/qbzzt1/zk/node_modules/.pnpm/@solidity-parser+parser@0.16.2/node_modules/@solidity-parser/parser/dist/index.cjs.js:35686:17)
at /home/qbzzt1/zk/node_modules/.pnpm/@solidity-parser+parser@0.16.2/node_modules/@solidity-parser/parser/dist/index.cjs.js:35722:51
at Array.map (<anonymous>)
at ASTBuilder.visitBlock (/home/qbzzt1/zk/node_modules/.pnpm/@solidity-parser+parser@0.16.2/node_modules/@solidity-parser/parser/dist/index.cjs.js:35722:35)
at ASTBuilder.visitFunctionDefinition (/home/qbzzt1/zk/node_modules/.pnpm/@solidity-parser+parser@0.16.2/node_modules/@solidity-parser/parser/dist/index.cjs.js:35761:20)
at FunctionDefinitionContext.accept (/home/qbzzt1/zk/node_modules/.pnpm/@solidity-parser+parser@0.16.2/node_modules/@solidity-parser/parser/dist/index.cjs.js:32766:22)
Node.js v20.15.0
ELIFECYCLE Command failed with exit code 1.
When Solidity compilation fails, can we try to do a forge build and get the error message from that? It makes a lot more sense.
When I issue
pnpm build
inpackages/contract
, and I have a syntax error, I often get something I can't understand, such asWhen Solidity compilation fails, can we try to do a
forge build
and get the error message from that? It makes a lot more sense.