-
Notifications
You must be signed in to change notification settings - Fork 601
Closed
Description
The problem
I found an issue when importing classes that in turn import icon variables. This fails in 0.6.7, but works in 0.6.6.
The errors only occur when I use imports from c.d2 as icons. I tried changing icon: to label: in b.d2 and it worked. I tried importing everything from a.d2 and it works too, but this doesn't really fit my use case.
I am not sure but maybe it is something related to #2066, because the error message indicates that a remote image has been detected as a local image. But I don't know why this happens with this specific importing structure.
How to replicate
I have the following files in the same directory:
# a.d2 (the file to compile)
...@b.d2
a1: {
class: Ecs
}
a2: {
class: Lambda
}
a1 -> a2# b.d2 (the file with the classes)
...@c.d2
classes: {
Ecs: {
shape: "circle"
icon: ${icons.ecs}
}
Lambda: {
shape: "hexagon"
icon: ${icons.lambda}
}
}# c.d2 (the file with the icons)
vars: {
icons: {
ecs: "https://icons.terrastruct.com/aws%2FCompute%2FAmazon-Elastic-Container-Service.svg"
lambda: "https://icons.terrastruct.com/aws%2FCompute%2FAWS-Lambda.svg"
}
}Depending on the version of D2 that I'm using, the behavior is different.
- With version
0.6.6I get the following diagram:
- With version
0.6.7I get the following errors:
Errors
err: failed to bundle .: read .: is a directory
err: failed to compile -: failed to bundle local images: [.]
Set up
- I'm running D2 from VSCode 1.93.1
- D2 VSCode extension v0.8.8
- macOS 15.0.1 (chip M2)
alixander, sanguineti and bamavrakis
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Done