-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Cannot destructure property body
of 'undefined' or 'null' (5.1.10 to any later version)
#2834
Comments
Hey @slmatthiesen ! 👋 Can you share a reproduction repo for debugging purposes? |
I'm getting the error doing the pet-shop tutorial - executing 'truffle test':
truffle version EDIT: downgraded to truffle v5.1.10 and working now! |
Thanks for sharing that @README55 ! I notice both you and @slmatthiesen are on Windows 🤔. |
Investigated a bit, this looks like a compilation OS-compatibility path issue. |
Hooray a path compatibility issue! We'll have to dig into this. Thanks for raising this! |
Actually, it might be a missing cc @eggplantzzz |
Big ups to @README55 and thank you @CruzMolina |
Does anyone have reproduction steps for this error? It would be super helpful in diagnosing this. So far it looks like we only have a vague guess as to what is causing this. |
Sure thing - On a windows machine:
**and
Downgrading to 5.1.10 on my personal contract does allow me to deploy it without issue. |
Thanks very much @slmatthiesen! I'll see if I can duplicate this on my mac. |
So I can confirm that your code example is able to run |
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. |
@topnotchbiz downgrading solved my issue. Thank you! Running on Windows with the following versions when this issue occurred: Truffle v5.1.15 (core: 5.1.15) |
I also met this problem right after upgrading to v5.1.18. I had tested this on my Windows 7 laptop with Node.js 10.15 and Ubuntu 16 guest of Virtual Boxy with Node.js 10.19, and found the same problem. I downgraded my Truffle back to v5.1.9 and the problem disappeared. So, this problem is taught to appear after v5.1.10. |
Same happens to me on windows 10 (64bit) C:\Users\Alan\Documents\DAPPS\pet-shop-tutorial>truffle version |
i got the same issue with 5.1.19 / when i downgrade to 5.1.9 all compile perfectly. I try to investigate the issue, but i really don't know where it come from. |
Today, I got this error, with truffle 5.1.14 in Windows 10 I removed |
Oh. Well for me on windows 10, even after I removed the build directory from pet-shop-tutorialTruffle compile is OkTruffle migrate is OkTruffle test fails with the above error.Truffle version givesTruffle v5.1.14 (core: 5.1.14)Solidity - 0.5.10 (solc-js)Node v13.11.0Web3.js v1.2.1Alan Reed On 5 Apr 2020 16:51, ajlopez <[email protected]> wrote:
Today, I got this error, with truffle 5.1.14 in Windows 10
I removed build directory, and then truffle compile worked
—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or unsubscribe.
|
With the new release out (5.1.20) I thought I'd give it a try again.
And the same project that didn't compile for me a month+ ago now compiled successfully! Give it a try if you are having issues. If you need to revert just: |
Also experienced this issue with Truffle 5.1.20 |
I experienced the same issue on Windows 10 ([email protected]) while using the MetaCoin box. The error was referring to the ConvertLib.sol library.
Reverting to 5.1.10 solved the issue. |
yes,this problem can be solved by |
Can we fix this? I need something older than Update: Fixed in #3075. Thanks @CruzMolina for the direction. |
So does the problem still occur on version 5.1.33? It looks like some of the people in here had it resolve for them? |
Adding my 2c, I am able to compile a couple of my codebases successfully on Windows with: version 5.1.33 |
Just updated my project to use 5.1.33 and this issue is still occurring for me Edit:
|
So just to confirm @spresnal, you get this error after you unbox the metacoin project and run I'll have to go get a Windows machine to see if I can reproduce and troubleshoot this. |
I confirm . I get this error after you unbox the metacoin project and run truffle test.Or https://www.trufflesuite.com/tutorials/pet-shop
truffle version |
For anyone stumbling across this problem ^ is the quick fix |
@gnidan Why is this closed? How is downgrading the library considered to be a valid solution? I don't want to downgrade just to use one project. This should NOT be closed. Also, the problem occurs when running "test", not migrate. I have the issue on Truffle v5.1.13. |
@avrdan Fixed since v5.1.35: https://github.com/trufflesuite/truffle/releases/tag/v5.1.35. |
Didn't see anything there.
I didn't see anything in the release notes that called anything out.
Looks like another related issue here:
Debug transaction - " TypeError: Cannot destructure property source of 'undefined' or 'null'." #1574 and [BUG] Cannot destructure property
context
of 'undefined' or 'null'. @ truffle debug #1365 and Console crashes when it runs a long time #991 and Cannot read property 'replace' of undefined #1936with 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
truffle version
): 5.1.13node --version
): 12.15.0npm --version
): 6.13.7The text was updated successfully, but these errors were encountered: