Cannot destructure property `body` of 'undefined' or 'null' (5.1.10 to any later version)
See original GitHub issue- [ X ] I’ve asked for help in the Truffle Gitter before filing this issue. Didn’t see anything there. I didn’t see anything in the release notes that called anything out. Looks like another related issue here: https://github.com/trufflesuite/truffle/issues/1574 and https://github.com/trufflesuite/truffle/issues/1365 and https://github.com/trufflesuite/truffle/issues/991 and https://github.com/trufflesuite/truffle/issues/1936 with zero info.
I’ve been using truffle with the same contract consistently for a while now (6 months easily). This latest upgrade 5.1.10 to 5.1.13 (I missed one) is the first time I’ve seen this error. Wondering if anyone else has.
Solution
Downgrading to 5.1.10 allows me to truffle migrate --network development without issue.
Issue
I’ve been using the same contract for 6+ months. After upgrading from 5.1.10 to 5.1.1x , I started getting this error when attempting to launch my contract on any network:
Cannot destructure property body
of ‘undefined’ or ‘null’
Downgrading to 5.1.10 allows me to launch my contract again. Worked my way down from 5.1.13 to 5.1.10.
Steps to Reproduce
truffle migrate --network development or truffle migrate --network ropsten
Expected Behavior
My contract would compile and launch as expected.
Actual Results
√ Fetching solc version list from solc-bin. Attempt #1
Error: TypeError: Error parsing C:/Users/Mine/Projects/project/contracts/Contract.sol: Cannot destructure property body
of ‘undefined’ or ‘null’.
at Object.compile (C:\Users\Mine\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\workflow-compile\legacy\index.js:80:1)
Environment
- Operating System: Windows
- Ethereum client:
- Truffle version (
truffle version
): 5.1.13 - node version (
node --version
): 12.15.0 - npm version (
npm --version
): 6.13.7
Issue Analytics
- State:
- Created 4 years ago
- Comments:33 (13 by maintainers)
Top GitHub Comments
yes,this problem can be solved by npm install truffle@5.1.9 -g and then delete the build directory and re-compile and migrate the contract
Thanks @slmatthiesen and thanks you @CruzMolina . I had same issue using v5.1.15 and the old v5.1.10 solved my issue. Thanks again.