You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running the WokWi Diagram Editor as the editor in an editor tab in VSCode, for diagram.json, if there is a custom chip in the project, e.g. custom.chip.json and custom.chip.c files, and the diagram.json is referring to this in parts as "type": "chip-custom", the WokWi Diagram Editor shows a confusing error message Missing chip chip-custom in the part image in the editor and drops the connections with the custom chip.
To Reproduce
Install VSCode and WokWi Simulator extension to VSCode (if you don't have them already)
The custom chip in the project (Inverter) should appear as the defined custom chip, with connections to the other chips.
Current behavior
The custom chip in the project (Inverter) appears as a Missing chip, with no connections to other chips.
Work around
There must be a dist folder, with chip.json and chip.wasm. At this point, VSCode does not produce them automatically but one must build the dist folder and its contents manually.
This bug appears to be there also with the WokWi Pro license activated.
Additional context
At https://wokwi.com/_next/static/chunks/4729-9dd899e2e960fade.js in function getChip(t), the chips are only looked at https://wokwi.com/api/external/chips. This does not make sense here, since the chip definition is on the local disk of the VScode host. For custom chips defined in the project, the WokWi extension should first upload the local file to somewhere in the wokwi.com domain so that the WokWi Editor, running in the iframe, could download and read it. The WokWi Editor cannot try to read the file directly from the local disk, as the iframe cannot escape its sandbox. Or, if the WokWi Simulator extension already does upload the file for including it in https://wokwi.com/api/external/chips, there appears to be a bug somewhere else.
As a workaround, one could add a possibility to define a custom URL path for custom chips, allowing the WokWi Editor in the iframe to load the code from a custom URL (if allowed by sandboxing, I don't remember...).
( I hate debugging closed source obfuscated JS code. Hence, there may be errors in my analysis. I didn't want to spend too much time in debugging this. )
The text was updated successfully, but these errors were encountered:
pekkanikander
changed the title
VSCode WokWi Diagram Editor does not understand custom chips, dropping connections to them and labelling them as "Missing"
VSCode WokWi Diagram Editor documentation unclear, leading to custom chips labeled as "Missing" and with no connection
Jan 17, 2025
pekkanikander
changed the title
VSCode WokWi Diagram Editor documentation unclear, leading to custom chips labeled as "Missing" and with no connection
VSCode WokWi Diagram Editor documentation unclear, leading to custom chips labeled as "Missing" and with no connections shown
Jan 17, 2025
Describe the bug
When running the WokWi Diagram Editor as the editor in an editor tab in VSCode, for
diagram.json
, if there is a custom chip in the project, e.g.custom.chip.json
andcustom.chip.c
files, and thediagram.json
is referring to this inparts
as"type": "chip-custom"
, the WokWi Diagram Editor shows a confusing error messageMissing chip chip-custom
in the part image in the editor and drops the connections with the custom chip.To Reproduce
diagram.json
for editingExpected behavior
The custom chip in the project (Inverter) should appear as the defined custom chip, with connections to the other chips.
Current behavior
The custom chip in the project (Inverter) appears as a
Missing chip
, with no connections to other chips.Work around
There must be a
dist
folder, withchip.json
andchip.wasm
. At this point, VSCode does not produce them automatically but one must build thedist
folder and its contents manually.Environment
macOS 15.2 (24C101)
Safari 18.2 (20620.1.16.11.8)
VSCodium 1.96.2 Release: 24355,
WokWi Simulator extension 2.6.0 - 2024-12-10.
This bug appears to be there also with the WokWi Pro license activated.
Additional context
At https://wokwi.com/_next/static/chunks/4729-9dd899e2e960fade.js in function
getChip(t)
, the chips are only looked athttps://wokwi.com/api/external/chips
. This does not make sense here, since the chip definition is on the local disk of the VScode host. For custom chips defined in the project, the WokWi extension should first upload the local file to somewhere in thewokwi.com
domain so that the WokWi Editor, running in the iframe, could download and read it. The WokWi Editor cannot try to read the file directly from the local disk, as the iframe cannot escape its sandbox. Or, if the WokWi Simulator extension already does upload the file for including it inhttps://wokwi.com/api/external/chips
, there appears to be a bug somewhere else.As a workaround, one could add a possibility to define a custom URL path for custom chips, allowing the WokWi Editor in the iframe to load the code from a custom URL (if allowed by sandboxing, I don't remember...).
( I hate debugging closed source obfuscated JS code. Hence, there may be errors in my analysis. I didn't want to spend too much time in debugging this. )
The text was updated successfully, but these errors were encountered: