Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read properties of undefined (reading 'nodeType') #48

Open
oliwiaanna03 opened this issue Feb 19, 2024 · 4 comments
Open

Comments

@oliwiaanna03
Copy link

I cloned the repository and navigated to the project folder. Upon installation of the package using yarn, I attempted to use a script using the command yarn analyze contracts scope.example.txt. However, I consistently encounter the following error:

Cannot compile AST for contracts/example/Test.sol
/github/xxx/node_modules/solidity-ast/utils/find-all.js:19
  const push = node => queue.push({ node, props: getNextProps(nodeType, node.nodeType ?? '$other', cache) });
                                                                             ^
TypeError: Cannot read properties of undefined (reading 'nodeType')
    at push (/github/xxx/node_modules/solidity-ast/utils/find-all.js:19:78)
    at findAll (/github/xxx/node_modules/solidity-ast/utils/find-all.js:21:3)
    at findAll.next (<anonymous>)
    at Object.detector (/github/xxx/src/issues/NC/uselessOverride.ts:15:18)
    at analyze (/github/xxx/src/analyze.ts:43:25)
    at main (/github/xxx/src/main.ts:69:22)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Of course for the purpose of anonimity I change my true path to /github/xxx/.

What should I do to use script? I use macbook and Visual Studio Code.

@igorbalden
Copy link

igorbalden commented Feb 21, 2024

Same error in Ubuntu20.
A quick fix is to go back one commit.
$ git reset --hard HEAD~1
or
$ git reset --hard 098627c

@devival
Copy link

devival commented Mar 2, 2024

The same error appears no matter the OS, going back one commit indeed helps but I'd also like to try the recent contributions by @JustDravee,
Do you have any ideas on this?

@devival
Copy link

devival commented Mar 2, 2024

Removing src/issues/NC/uselessOverride.ts has worked for me.

@Top88Star
Copy link

Removing src/issues/NC/uselessOverride.ts has worked for me.

Works for me too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants