DOPΣ - umm what todo here, in cli, its passing ...
umm what todo here, in cli, its passing url like that, unlike runframe

32 Replies
yea that's correct
i think you didn't add core support
i have no idea how it's working in RunFrame
ehhhh
wait so does it accept a url or no?
basically if the user passes in a path, you have to load it as a url
eval should transform that url to circuitjson
as per working and u guided, thats how working in runframe
ehhh
i think core doesn't recognize it as a url so it doesn't get sent to eval
do u see what i'm saying
it's not a major thing, it's like a simple "is this a url" thing i think
unless core doesn't have async load support, which is what i originally thought, but then i was like "ehh i think core has async load and it's just confused and thinks the path isn't a url"
does that make sense
basically core should be like "oh this is a url" and send to platformConfig.kicad_mod.loadFromUrl
is this ok?

yea that looks right!
did you fix it w/o modifying core?
runframe api, doesnt pass raw static assets

thats problem
any fix? or this ok
oh ok but you identified another bug because the error is really really bad in this case

wait kicad_mod is a static asset
yup, thats dillema
it's not a dynamic file extension (that name sucks)
with marking it static, it isnt working
ik you didn't come up w/ the name but that's a dumb name (i probably wrote it)
yea i think it's the issue i mentioned where core doesn't handle urls that are absolute paths
umm????? but core doesnt handle urls, isnt eval does? too confusion 😢

importLocalFile is in eval
yea there's something weird going on, you should just do:
it should be a url
or a path
if it's
__STATIC_ASSET__
then something weird is happening
also fwiw that core error is really bad and we'd probably be happier if we made the error better here
it might make understanding easier
e.g. it seems like core might have failed to parse something but i'm not surecos thats passed by our runframe
not by core
cant see logs, as circuit is working in runframe
throw new Error("...") maybe

this url is coming, ig its wrong. it should be /footprint,kicad_mod
prolly something wrong with runframewithapi, doesnt pass raw assets
you added support for STATIC_ASSET, did u know where u added logic to handle it?
no that looks correct
the issue is in core i think
i think core isn't fetching the asset
..

hehe you can ignore
__STATIC_ASSET__
it's literally a placeholder because the file is never requested
*the string is never requested
or used etc.
you need to handle /api/..../whatever.kicad_mod
in core
core doesn't know that it's a urlahh kk understood, pretty confusion ill try it
then kicad parser should also be added to core
would that be ok?
no it shouldn't be
that's the point of
platformConfig.kicad_mod.loadFromUrl
in your test, you can just mock it and provide a platform config that returns a simple footprint or whateverohohohohoohoh
its for tests?

whats alternate?

GitHub
Implement KiCad footprint loading support from asset url by ArnavK-...
related tscircuit/tscircuit#768
GitHub
Implement KiCad footprint loading support from asset url by ArnavK-...
related tscircuit/tscircuit#768