dyatko / arkit

JavaScript architecture diagrams and dependency graphs

Home Page:https://arkit.pro

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

alghouliammar1 opened this issue · comments

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?

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.