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: componentsByName[component.name].push is not a function #940

Open
alghouliammar1 opened this issue Jul 31, 2022 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@alghouliammar1
Copy link

Bug Description
when I try to get the diagram of my NodeJS file I use the command "npx arkit -f .\code\code.js -o code.svg"
I got this error
orignalcode\node_modules\arkit\dist\generator.js:124
componentsByName[component.name].push(component);
^

TypeError: componentsByName[component.name].push is not a function

can anyone help me please to get over this error?

@alghouliammar1 alghouliammar1 added the bug Something isn't working label Jul 31, 2022
@smurp
Copy link

smurp commented Jul 16, 2023

ah. I've figured out what the cause is....

When the component happens to have a name which matches one of the method names on Array (in my case it was 'toString' (which was in a file called bower_components/jquery/src/var/toString.js) then push is not a function because the value of componentsByName[component.name] is a Function, not an Array, and so does not have a push function on it.

Just sharing this insight before going to be. Might try to fix this in the morning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants