netlistsvg icon indicating copy to clipboard operation
netlistsvg copied to clipboard

TypeError: Cannot read property 'startsWith' of undefined at built/Skin.js:11

Open eMPee584 opened this issue 2 years ago • 5 comments

When trying to generate a schematic from a skidl definition I run into this error:

/usr/local/lib/node_modules/netlistsvg/built/Skin.js:11
                return e[1]['s:pid'].startsWith(prefix);
                                     ^

TypeError: Cannot read property 'startsWith' of undefined
    at /usr/local/lib/node_modules/netlistsvg/built/Skin.js:11:38
    at arrayFilter (/usr/local/lib/node_modules/netlistsvg/node_modules/lodash/lodash.js:596:11)
    at Function.filter (/usr/local/lib/node_modules/netlistsvg/node_modules/lodash/lodash.js:9241:14)
    at Object.getPortsWithPrefix (/usr/local/lib/node_modules/netlistsvg/built/Skin.js:9:23)
    at Cell.buildElkChild (/usr/local/lib/node_modules/netlistsvg/built/Cell.js:213:36)
    at /usr/local/lib/node_modules/netlistsvg/built/elkGraph.js:12:18
    at Array.map (<anonymous>)
    at Object.buildElkGraph (/usr/local/lib/node_modules/netlistsvg/built/elkGraph.js:11:33)
    at Object.render (/usr/local/lib/node_modules/netlistsvg/built/index.js:43:29)
    at render (/usr/local/lib/node_modules/netlistsvg/bin/netlistsvg.js:23:9)
    at /usr/local/lib/node_modules/netlistsvg/bin/netlistsvg.js:57:9
    at /usr/local/lib/node_modules/netlistsvg/bin/netlistsvg.js:41:17
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:69:3)
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)

This in an ubuntu-based jupyterlab docker image with current pyspice, skidl and netlist installed manually.. any ideas what could be the problem?

eMPee584 avatar Oct 12 '21 23:10 eMPee584

Do you have a reproducible input json?

nobodywasishere avatar Oct 12 '21 23:10 nobodywasishere

Mhh. How would I get that?

I use skidl's generate_svg()..

eMPee584 avatar Oct 19 '21 12:10 eMPee584

.. also, generate_netlist() throws a

ERROR: No footprint for GND/#PWR1.
ERROR: No footprint for VCC/#PWR2.
ERROR: No footprint for Q_PNP_CBE/Q1.
ERROR: No footprint for Q_PNP_CBE/Q2.
ERROR: No footprint for R/R1.
ERROR: No footprint for R/R2.
ERROR: No footprint for R/R3.
ERROR: No footprint for R/R4.
ERROR: No footprint for R/R5.

0 warnings found during netlist generation.
9 errors found during netlist generation.


eMPee584 avatar Oct 19 '21 12:10 eMPee584

Ah I see what you mean. Can you make sure you're using the latest version of netlistsvg from github? This may be related to this issue https://github.com/xesscorp/skidl/issues/118

nobodywasishere avatar Oct 19 '21 15:10 nobodywasishere

Mhh thanks ok I tried npm-installing the git version and now I get image

eMPee584 avatar Oct 19 '21 20:10 eMPee584